Here is my code for the create event:
max_speed = 12;
And here is my code for the step event:
hspeed = joystick_xpos(1) * max_speed;
vspeed = joystick_ypos(1) * max_speed;
if (joystick_xpos(1) = 0) {hspeed = 0;}
if (joystick_ypos(1) = 0) { vspeed = 0;}The problem is, after releasing the joystick, the object continues and drifts in a left and/or up direction. As I've looked in debug mode, joystick_xpos and joystick_ypos do not return to 0 so therefore the object isn't stopped.
Is there a way I can get the joystick to return 0 when it isn't being moved so the object will stop, and if so what is it?



Find content
Not Telling

