#Jittering Issues. 2D Game. Camera? Physics? Frames?

1 messages · Page 1 of 1 (latest)

faint yacht
#

Hello 🙂 So In certain situations; I am getting a jittering player (and sometimes a jittering moving platform too when the player is on the moving platform). I'm using Godot 4.3. and GD script.

I'm wondering if there is a known fix for this? I have uploaded a video to show you what I mean. The jittering doesn't happen all the time. It just seems to be in random places; mostly in places where the player is moving a lot, or is stood on something that is moving a lot.

And it seems to be the player character that is most affected by this. (If you look at the player when on this moving platform that is when you will see a lot of jitter.) It sometimes happens if the player is also just running normally on the ground.

The camera2D is a child of the Player node. I have seen there is a jitter fix setting in the Godot project settings; and I have tried playing about with that but it does not seem to do much. I've tried setting that to 2.0, but I couldn't see much difference.

Is it potentially the frames per second setting of the game project itself? I've got a feeling it's something to do with the physics ticks? Frames? Between the camera2D, the player, and the Godot settings?

Thank you! 🙏

jolly flax
faint yacht
#

ah; perhaps it is this bit here? :

faint yacht
#

I think I might have actually found a fix for it; however; the fix also breaks something else. lol. (and I still need to do a lot more testing of the fix to see if it breaks anything else additional to this).

So what I tried was: in the Godot project settings I set physics interpolation on (enabled); and then I set physics jitter fix to 0.0. Settings > physics/common

I then went to the camera2D node in my level and turned physics interpolation off on that camera2D node itself.

By doing this; it has stopped any jittering and the camera also keeps its smoothness when lerping between points / zooms and such.

This seems to work absolutely perfectly; however; it then gives me a red error message in the debugger when I run my level scene which is;

<C++ Source> ./scene/main/node.h:446 @ get_tree()

Something about a data tree is null. Technically speaking the game works; and I cant see what it is actually breaking as such. But ideally the red debugger message needs to be sorted. I'd imagine this might be something in a global auto load script that has now broken? as a guess?

jolly flax
# faint yacht I think I might have actually found a fix for it; however; the fix also breaks s...

i can't remember having that error when experiementing with physics interpolation, but i have found this thread which seems to describe a situation quite similar to yours.
I would suggest to try to find a different way to solve the issue that doesn't require physics interpolation, like setting the process callback of the camera to physics.

faint yacht
faint yacht
#

Really late replay and update from me here. I had to wait for a chain of GitHub branch merges first before I could mess with my Godot Project settings. But this is what I tried with the camera jitters issue; and it seems like it has worked well so far:

On the camera2D node itself inside of the level scene; set the process callback to Physics. (like you suggested me to do).

Then in Godot Project settings itself; I also went to Physics > common > and set the physics jitter fix to "0".

And this seems to be working very well so far without any issue. (as far as I can see).

I just wanted to give you the update. And thank you so much, again, for your help @jolly flax

jolly flax