You don't want this code in _physics_process
, 20xxdd20.
Doing this will cause the player to feel lag in their mouse input, which I think is more unacceptable than jitter. In the first place, this is not even possible in _process
without convoluted code (which would definitely make the problem far worse).
But I'd be surprised if _input(ev)
causes any sort of performance overhead for your project. Even if you do nothing and have no code at all, the engine ensures the following queries always takes place every single frame:
(has something happened? i.e, the mouse moves), then:
> query the _input(ev)
function
> query the Control
nodes
> query _unhandled_input(ev)
> finally, query the CollisionObject
nodes (3D/2D camera casting)
This happens even with no code. Did you notice?
Especially in Godot, but also as standard practice, it's generally the content of your code that is responsible for the major (lack of) performance, not so much where you are putting it.
From experience, I'm pretty confident you'll find that your jittering issue lies elsewhere.