Hi there, I’ve had issues with jittery player movement since I began with godot last week and have been trying to find a fix since.
I have tried altering Physics Ticks per Second to match the refresh rate of my monitor (60Hz) and have tried setting this much higher (240 ticks) as some people said this worked, but it did not.
I also tried splitting my code between the _process() and _physics_process() loops in countless ways but saw no change.
The problem is likely not the movement either since it occurs with multiple different movement techniques I have tried [incl. setting the position directly and using move_and_slide()], and the tutorials I followed seemed to have fluid movement unlike mine.
I replicated the official documentation guide and copied the source code directly, and the issue is still present as shown in video #1. This issue also happens with other projects with different movement including the one attached in video #2.
If your player is moving using physics, you’ll need physics interpolation. It’s not builtin for 2D yet, but this addon should work fine: GitHub - lawnjelly/smoothing-addon at 4.x
If this is happening when you are moving your player manually (by accessing the transform in _process directly for example), the issue is most likely your movement code. (Hardware/OS or performance issues are possible too, but unlikely)
That seems very odd do you know if a GitHub issue exists?
I would think apply force and apply torque would be smooth enough. Character class don’t make sense to me since you adjust velocity and rotation move and slide does sort of magic.
I’ve tried both solutions but nothing changed, I’m sure I implemented them correctly as I followed GitHub’s instructions for the plugin and saw movement speed changes when using lerp, but still had the same jittery / stuttery effect.
I don’t think the movement code is the issue since I’ve used code from mutiple different sources which worked fine for them and I’m certain it’s not a hardware problem since I’m able to run much more complex games with no problems.
Sorry for being difficult, I’m happy to give any more insight if it helps!
The first video directly changes the position where the second uses move_and_slide().
I’m now certain that it’s nothing to do with the movement code though, I tried using a project from the asset library when starting godot and still had the same issues:
It seems to go through phases of being okay to going absolutely nuts, i’ll try updating my drivers again because I’m sure the issue is with the rendering like you say.
Edit: Updating drivers did nothing which I’m slightly happy about because it saved me the embarrassment
Issue solved - Setting V-Sync to disabled or ‘mailbox’ (?) solves the issue, I’m not exactly sure why and I hope tearing doesn’t become an issue later on when I’m working on more complex projects.
Thanks very much for all of your help tho! Happy to give more info about it if you want to understand why it happened.