GDScript replace Mouse Camera with Joystick?

:information_source: Attention Topic was automatically imported from the old Question2Answer platform.
:bust_in_silhouette: Asked By HaptikRevamp

Is there some way to replace Mouse Camera rotation with the Joysticks instead? Im fairly new to Godot and im still trying to get the hang of the engine here is the code:

func _input(event):
if event is InputEventMouseMotion:
	rotation_degrees.y -= event.relative.x * mouse_sensetivity
	camera_pivot.rotation_degrees.x -= event.relative.y * mouse_sensetivity
	camera_pivot.rotation_degrees.x = clamp(camera_pivot.rotation_degrees.x, min_pitch, max_pitch)

Is there a way to make this work for the right thumbstick instead? the game is for controllers only.