- Edited
I'm trying to rotate my camera when the right joystick on a gamepad moves around, but the result of the code below is a little wonky - does not consistently work. Whenever the axis_value
reaches 1 or -1, the camera stops rotating.
var sensitivity = 0.005
func _input(event):
if event is InputEventJoypadMotion:
if event.axis == 2:
rotate_y(-event.axis_value * sensitivity)
elif event.axis == 3:
rotate_x(-event.axis_value * sensitivity)