Moving Robot based on Variables

I am using a joystick to control the robot. I have the buttons all mapped and assigned in a loop that will show me the value of each button on the controller. I want to have the joystick of the Xbox controller be able to move it in X and Y. How might I be able to program the robot to react to these variables and only move when the respective variable is high. I tried to make if statements that would trigger a distance move until expression went low but it stops working as it gets stuck in the if statement and does not see the button change status from the rest of the program. Thanks for the help.

Well. You can do it as you explained yourself. You just have to change your If command to continuously check the expression. Then it will exit the If command if the expression becomes false during execution. :slight_smile:

EDIT: You should also include stopl(2) after all If commands to allow for the robot to decelerate after exiting a movement abrubtly.