What causes 3D stutter on extremely simple scene? (Godot v4.0.2)

:information_source: Attention Topic was automatically imported from the old Question2Answer platform.
:bust_in_silhouette: Asked By Vododovoodvod

Hi, I have issue that’s quite annoying, and I’m hoping to get some help.

I created very simple FPS control project, CharacterBody3D with a camera and few lines of code for controls walking around simple StaticBody3D cube. As plain as it gets, literally invested 10 minutes in it.

However, I get stutter each 300 frames or so, visible in gameplay. Regular frame duration is ~16ms, when it stutter it goes up to 75. In profiler I saw that frame before stutter a couple of more processes is active (Physics 3D and 2D Integrate forces, Audio Thread etc., but each take 0.00ms).
I can see stutter even when project is exported (without Debug).

I’m working on Pop_OS! with up to date official nvidia drivers.
My hardware is AMD Ryzen 7 3700x, 32GB of RAM, GeForce RTX 3050, running from SSD.

You can download and check project.

Why does this happen on such basic level of complexity?

:bust_in_silhouette: Reply From: matthait

I’m not sure if this helps, but I found that when using spring arm for my camera in my 3d character controller I would get reproducible errors that caused terrible screen tearing and jitter due to the look_at function throwing errors. Removing springarm fixed my particular issue.

Looking at the debugger during the jittery moments clued me in on this specific error.

Maybe that is helpful in your search.