Need assistance with setting up a pid output.

Hey, I finally got my pid loop to work. Only one problem, when I use the button I’ve set to st the motors to the output, they go to the output at the time they were pressed, but this doesn’t change unless I press the button once more. I.e if the motor would go full speed as it was X distance from the goal, it would go full speed until I press the button again, it would then go th speed it needs to BASED ON THE TIME it was once again pushed. Here is the output code
(Using a tablet. Sorry if this comes out slightly off)

if (stick>GetRawButton(9))
{Motor>Set(output);
}

This is using iterative robot BTW.

The problem is that you are only setting a new value to the motor whenever you press the button, when you don’t have the button pressed it just continues on with whatever input it had last. You should probably have the motor speed continuously updated if you are using it with a PID loop.