I'm very new to programming and game development but something I've heard is having features like controller support is very important in reaching as many people as possible. I've figured out the input mapping for basic things like movement with the left stick but I can't seem to figure out anything for camera controls after following a tutorial by Bramwell. How would I go about adding in that kind of support?
(Code provided below, apologies if this isn't how you're supposed to show the code)

extends RigidBody3D

var mouse_sensitivity := 0.001
var twist_input := 0.0
var pitch_input := 0.0

@onready var twist_pivot := $TwistPivot
@onready var pitch_pivot := $TwistPivot/PitchPivot

func _ready():
Input.set_mouse_mode(Input.MOUSE_MODE_CAPTURED)

func _process(delta):
var input := Vector3.ZERO
input.x = Input.get_axis("Left", "Right")
input.z = Input.get_axis("Forward", "Back")

apply_central_force(twist_pivot.basis * input * 1200.0 * delta)




if Input.is_action_just_pressed("Escape"):
	Input.set_mouse_mode(Input.MOUSE_MODE_VISIBLE)
	

twist_pivot.rotate_y(twist_input)
pitch_pivot.rotate_x(pitch_input)
pitch_pivot.rotation.x = clamp(pitch_pivot.rotation.x, 
deg_to_rad(-30), 
deg_to_rad(30)
)
twist_input = 0.0
pitch_input = 0.0

func _unhandled_input(event: InputEvent):

if event is InputEventMouseMotion:
	
	if Input.get_mouse_mode() == Input.MOUSE_MODE_CAPTURED:
		twist_input = - event.relative.x * mouse_sensitivity
		pitch_input = - event.relative.y * mouse_sensitivity