Create a variable to store the mouse motion
Set the mouse mode to captured
This ensures mouse movement is
captured even outside the game window
Add the built-in function to handle input events
if the event is mouse motion and the mouse is captured
set the mouse motion variable to the relative inverse
multiply this by a small number to reduce mouse sensitivity
If the escape key is pressed
make the mouse cursor visible again
Add another function for camera rotation
rotate the y axis by the amount
of motion on the mouse x axis
reset the mouse motion to 0
so you don't rotate infinitely
Remember to call the camera rotation
function in the physics_process function