Gamepad right stick

hi I’m making a 3d fps game and ive figured out how to map my controller to move my character except the right stick for looking around
please help me out and im not that good at coding so explain like im five

Wherever you handle your input, do this:

func _input(event):
	# Checking right analog stick input for "mouse look"
	if event is InputEventJoypadMotion:
		if event.get_axis() == 2:
			joystick_v_event = event
		if event.get_axis() == 3:
			joystick_h_event = event

Then you can use these later in your code. here’s an example that also takes a deadzone into account:

func _physics_process(delta):
   if joystick_h_event:
			if abs(joystick_h_event.get_axis_value()) > JOY_DEADZONE:
				# DO STUFF HERE for left and right.
   if joystick_v_event:
		if abs(joystick_v_event.get_axis_value()) > JOY_DEADZONE:
			# DO STUFF HERE for up and down.