Hi guys! I’ve been working on a simple platformer for which I’ve made my own pixel art assets (they’re not great but, you know, doing my best )
Right now, I’m creating some moving platforms and I’m working on the vertical moving ones and here I have a problem : a very ugly “jitter”/“noise” (I don’t know how to call it) appears when my character stands on them.
Here is a video of what I’m talking about : https://streamable.com/xsu9zi
At first, I was moving the platform through tweens, I imagined that was the problem so I changed and moved the position directly and rounded the position of the platforms. But nothing is changing anything.
I’ve left the tween version (commented in the code) …Well, i’ve read a few threads on google and on this forum but I couldn’t find any solution so if you have ANY ideas, feel free to reach out!
What might be causing the issue is the round() function used for the real_pos float. Rounding would remove the positions in-between the whole number positions.
Use CharacterBody2d for your moving platforms especially if your player is a physics object. It was designed specifically for this use case, in fact, it has specific settings for moving platforms.
Thanks for the suggestion! I tried without the round() function but it didn’t make any difference sadly. Actually, my first script was without and I read about this function when I was looking to correct this “stuttering” effect but as you point out, it’s not good with OR without…
Hi everyone!
To try and find out what’s going on, I changed a few things : the movement script was in a “component” so for testing purposes, I moved it on the AnimatableBody.
I remove the round() function and the movement logic is called in the _physics_process now.
I also removed any unnecessary things (the real_pos variable and the tween comments).
But for now, I can’t see no changes, in good or bad…
Here is the new code :