Hello! I have a cursor in my game that controlled by gamepad's joystick.
How do I make a proper controls? Currently I am using four "If Joy X < deadzone -> cursor.x -10", but it feels janky and very limited. How do I get joy's angle?
This is for getting the angle of a gamepad joystick: This example uses the right joystick: angle(0,0,Gamepad.Axis(0,2),Gamepad.Axis(0,3))
To add to the previous comment you can use this event to move the cursor:
On every tick :
Cursor move distance(0,0,Gamepad.Axis(0,2),Gamepad.Axis(0,3))*dt at angle: angle(0,0,Gamepad.Axis(0,2),Gamepad.Axis(0,3))
Thanks for your response.
That's great! Thank you!
One more question, how do I get the tilt of the stick to calculate cursor's speed?
UPD: Thanks alot!
Develop games in your browser. Powerful, performant & highly capable.
See my previous comment - distance(0,0,Gamepad.Axis(0,2),Gamepad.Axis(0,3))*dt expression should move the cursor faster/slower depending on the tilt.