Help with Virtual gamepad example

You have the x and y amount for the analog stick sent to the player (ship) here:

Use those values to calculate the angle and use the angle to rotate the game object around the z-axis. Untested code:

go.set_rotation(vmath.quat_rotation_z(math.atan2(message.y, message.x)))

1 Like