I have a player that aims and shoots at things. I am trying to add gamepad support, but am having trouble as the tutorial I read is godot 4.0 which I don't have. Can someone help me?
#as part of process, gamepad is whether we are using a gamepad, and it works, "leftStick" contains all axes for Device 0, Left Stick
if !gamepad:
look_at(get_global_mouse_position())
rotation_degrees += 90
else:
var joystick_vector = Vector2(Input.get_joy_axis(0, 0), Input.get_joy_axis(0, 1)).normalized()
if joystick_vector.abs() > Vector2(0.1, 0.1)):
rotation = joystick_vector.angle()+PI/2
It makes a deadzone aimed up and down, I think because then the X value is too low.