In 2D or 3D? In 2D its a little easier, as you can just use the angle of the Vector2 from the gamepad on the rotation
or rotation_degrees
property. The harder part with 2D is just knowing how much of an angle offset you need to get the sprite looking in the right direction.
For 3D, its a little harder because of how Godot handles rotation in 3D, especially rotation over 180 degrees. I would suggest converting the Vector2 from the gamepad joystick axis to an angle, and then making a new Basis and rotating it by the angle. You could also try manually altering the rotation
property of the Spatial node, which may work.
Another possible solution for 3D is converting the gamepad axis to a Vector3 offset (one axis will need to be 0), then use look_at
to rotate the player to look at the offset. Something like look_at(global_transform.origin + joypad_vector2, Vector3.UP)