Hold Function Help

if(Controller1.ButtonB.pressing()){
DriveLeft.stop(brakeType::hold);
DriveRight.stop(brakeType::hold);
DriveRightBottom.stop(brakeType::hold);
DriveLeftBottom.stop(brakeType::hold);
}

is what I have currently in my Vex Coding Studio to help my robot be hard to push, I need to break it though, can anybody help. I have tried an else statement that refers to the drive code but the Hold function is still in play.

Can you show your else statement please?

if(Controller1.ButtonB.pressing()){
DriveLeft.stop(brakeType::hold);
DriveRight.stop(brakeType::hold);
DriveRightBottom.stop(brakeType::hold);
DriveLeftBottom.stop(brakeType::hold);
}
else{
DriveLeft.stop(brakeType::coast);
DriveRight.stop(brakeType::coast);
DriveRightBottom.stop(brakeType::coast);
DriveLeftBottom.stop(brakeType::coast);
}

Maybe try having a button that actually resets your brake mode.

You’re brake modes may be overriding each other.

if(Controller1.ButtonB.pressing()){
DriveLeft.stop(brakeType::hold);
DriveRight.stop(brakeType::hold);
DriveRightBottom.stop(brakeType::hold);
DriveLeftBottom.stop(brakeType::hold);
}
else{
DriveRight.spin(directionType::fwd,Controller1.Axis2.position(percentUnits::pct),velocityUnits::pct);
DriveRightBottom.spin(directionType::fwd,Controller1.Axis2.position(percentUnits::pct),velocityUnits::pct);
DriveLeft.spin(directionType::fwd,Controller1.Axis3.position(percentUnits::pct),velocityUnits::pct);
DriveLeftBottom.spin(directionType::fwd,Controller1.Axis3.position(percentUnits::pct),velocityUnits::pct);
}

The issue with this code is that it still makes my turning very jerky

And Driving jerky too

I wouldn’t do that. It’s way to complicated. Just keep it as simple as
if(Controller1.ButtonB.pressing()){
DriveLeft.stop(brakeType::hold);
DriveRight.stop(brakeType::hold);
DriveRightBottom.stop(brakeType::hold);
DriveLeftBottom.stop(brakeType::hold);
}
else if (Controller1.Button(your choice of a button).pressing(){
DriveLeft.stop(brakeType::coast);
DriveRight.stop(brakeType::coast);
DriveRightBottom.stop(brakeType::coast);
DriveLeftBottom.stop(brakeType::coast);
}

And your other code will not work because the brake mode of each individual motor will still be set to hold.

Is there a solution?