I'm trying to make a simple fps controller and am working on rotation with the mouse. This is the code I have.
const MOUSE_SENSETIVITY = .3
const MOUSE_SENSETIVITY_X = 1
if event is InputEventMouseMotion:
rotation_degrees.y -= event.relative.x * MOUSE_SENSETIVITY
$Camera.rotation_degrees.x -= event.relative.y * MOUSE_SENSETIVITY_X
The left and right rotation works fine, but together with the up and down rotation it's a little wonky. I was sure it would be, because I've never seen anyone do both x and y fps rotation the same way. To be honest I don't really know what I'm doing very well. :)
Could someone show me a better way to do it? Also could someone help explain how the code I've got works? My understanding of it is that its taking the current mouse motion and subtracting it from the last mouse motion to get the degrees it needs to set the characters rotation of it, but I'm not positive thats correct.