Godot Version
4.5.stable
Question
Hey, I am pretty new to godot and semi new to actually trying to program something more complex. I was not sure if this category is the best fir for the question but I feel like the other ones would have been a worse fit.
I am currently setting up a simple PlayerController again and was looking at other peoples examples to get a feel for a way to make it feel smooth and nice to use. Looking at other peoples examples I noticed some(plenty) use delta time to “scale” their mouse input. I understand that it is often used for movements to make them frame independent, but I feel like in this case it should hinder the input consistency of the mouse?
I am looking at a script like this:
func _unhandled_input(event: InputEvent) -> void>
if event is InputEventMouseMotion and Input.get_mouse_mode() == Input.MOUSE_MODE_CAMPTURED:
_camera_input_motion = event.screen_relative * sensitivity
func _physics_process(delta: float) -> void:
_camera_pivot.rotation.x += _camera_input_motion.y * delta
My thought being that if we “scale” our mouse movement with delta here we would essentially just change the amount of camera rotation we do with the same Input depending on our current fps.
Meaning by getting rid of the delta scaling we should have a controller that always rotates the camera by the same amount if the mouse Input is the same, in contrast to the camera rotating less if we suddenly have higher fps.
So my idea would be to use this:
func _unhandled_input(event: InputEvent) -> void>
if event is InputEventMouseMotion and Input.get_mouse_mode() == Input.MOUSE_MODE_CAMPTURED:
_camera_pivot.rotation.x += event.screen_relative * sensitivity
Am I looking at this the wrong way?