2D Particles jitters when my player character moves with interpolation on

Godot Version

4.5.1

Question

I have turned on physics interpolation on for my player character because it was jittering when it moved. This solved the problem, however caused another one to emerge. When the player starts to move or dash, I had set a certain particles to emit. When they emit from movement, to my surprise, they started jittering. It will only start jittering however when the player character was moving. When it stood still after the action, the jittering from the particles will stop.

The particles of the player character are children to the player character, and it’s interpolation setting is turned off.

Any help would be appreciated!

In my case, the jitter is caused by the fact that the physics tps is higher than display fps, meaning there are two physical updates happen instead of one for some of the frames, causing the physics-driven objects to advance by two intervals. This isn’t even noticeable really, as the camera is advanced in _physics_process too and moves in sync with the player. If I however try to move a time-driven object along with the camera, it is extremely jittery, as it advances by one step and thus is out of sync with the camera.

The physics interpolation seem to be useful when the frames are drawn more frequently than the physics updates occur. I don’t see how it could help if there are suddenly two physics updates instead of one in a given frame.

Haven’t found a satisfactory solution yet, but ideally to get rid of jitter, all objects, and the camera, need to advance by equal delta on all the frames. Might have to set tps to double the number of fps, so that there are two physics updates each frame.

Using CpuParticles instead of GpuParticles seems to solve the jitter problem for me.

If you’re married to using GpuParticles, you can also snap try snapping GpuParticles’ global_position to a 1x1 grid.

It would look something like this:

%YourParticles.global_position = global_position.snapped(Vector2(1,1)

In the above code you’d also need to have %YourParticles to be Top Level.

1 Like

Sorry for the late reply, this works! Thanks for the help!

I was struggling with this, too. Having GPUParticles as a child and setting their interpolation override seemed to be ignored.

In my case I was initializing the particles on game start, caching them.

Setting the interpolation to be disabled during caching via script solved the problem for me.