Why does set_time_scale jitter KinematicBody2D?

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

Hello, I’ve been having a problem with Engine.set_time_scale(val).

When I use it, after I reset it back to 1.0, the Player Node (a KinematicBody2D) starts jittering and lagging on movement. I tried doing this in the 3D engine and had no problems, but in 2D this keeps happening. I tried changing the PhysicsEngine, but no changes, and I tried switching from move_and_slide to move_and_collide. I also tried move_and_slide_with_snap, but again, same effect.

If I leave the set_time_scale to the lower value (I’m using 0.5), the character isn’t lagging, but once it resets, it starts happening.
The frames remain a stable 60, and I’ve checked that time_scale resets back to 1.0.

What is causing this problem? Anyone had something similar?

PS: This question was cross-posted on https://godotforums.org/discussion/26280/set-time-scale-jitters-kinematicbody2d.


Try installing, enabling and configuring lawnjelly’s smoothing-addon to benefit from physics interpolation.

Calinou | 2021-05-15 18:01