+1 vote

I have a Camera2Dattached to my Player, which is essentially just a KinematicBody2D. I have all of my movement code in _physics_process(), which is called directly from the KinematicBody2D.

When I run in one direction, I notice a kind visual stutter on everything in my scene except my sprite. It's as if the entire screen is shifted left or right for a split second and then shifted immediately back. I'm not able to capture it adequately in a video.

I notice this happening regardless of whether or not I have smoothing enabled, as well as whether or not I have use_pixel_snap, vsync, orhidpi enabled. I also notice it in both fullscreen and windowed mode. I even tried exporting my game to Mac OSX, but it's present even in the exported version. I even tried rounding the Player's position to integers, but no luck.

What might be causing this stuttering?

Because it's happening to the background and not the player sprite itself, I don't think it's related to these:

in Engine by (1,547 points)
edited by

1 Answer

0 votes

Use _physics_process() to handle your character's movements. This function is specialised for the physics because it uses a delta who never varies.

If you already using it : From where are you calling the movements ? Directly from the character's node ? If not, maybe the function relay isn't well processed by the engine.

by (162 points)
edited by

Thanks for the suggestions. Unfortunately, I already use _physics_process() and call from the Player node itself. I've updated my question to reflect this.

By the way I think I noticed what kind of stuttering you're talking about. I can't figure out what's causing it but I got a similar problem on a blank project : You go in one direction just fine and then the screen starts to "shake" around your sprite during half of a second and then goes back to a smooth scrolling ? And it seems to happen periodically when you keep moving ?

Very annoying, I agree. If you manage to find the cause before me, please share :-)

Yes, you seem to be describing exactly what I'm experiencing. There's a lot of stuff on the web about visual stuttering in Godot, but it's hard to tell if what others are describing is the same issue. As I mentioned, I seem to notice it not so much on the player Sprite itself, but on everything else in the scene. I will keep searching for a solution.

Welcome to Godot Engine Q&A, where you can ask questions and receive answers from other members of the community.

Please make sure to read How to use this Q&A? before posting your first questions.
Social login is currently unavailable. If you've previously logged in with a Facebook or GitHub account, use the I forgot my password link in the login box to set a password for your account. If you still can't access your account, send an email to webmaster@godotengine.org with your username.