Position Smoothing causing lag and stutter when Player stops

Godot Version

4.3

Question

Hello, this is probably a well known issue, so I’ll explain my case as detailed as possible:

Issue:
When my Player stops moving, the camera “smoothly” stops after (due to Position Smoothing enabled) but it stutters/tilts right at the last frames, “moving” the sprites by some pixels - besides that, I see no issue during movement. Here’s the link to a video.

I want the Camera to smoothly stops right after the Player stops, without any stuttering or sprites tilting.

Settings:

  • Position Smoothing: Enabled, 5px/s (if disabled of course there’s no issue);
  • Drag: Horizontal Enabled (tried disabling as well as enabling Vertical, nothing changes);
  • Project Settings > Stretch > Mode: Disabled (tried both Viewport and Canvas_items, nothing changes);
  • Project Settings > Stretch > Aspect: Keep
  • Project Settings > Stretch > Scale Mode: Fractional (tried Integer, nothing changes)

Semi-solution:
the only thing that fixes that issue is enabling Snap 2D Transforms to Pixel in Project Settings > Rendering > 2D, BUT, then the animations look too mechanical and “broken” due to pixel perfection, a clunky effect that I don’t want for my game.

I think the most effective solution might be to write a custom script for the Camera2D node, but being a newbie, I’m all ears for any suggestion with/without adding a script that might fix it.

Thank you for any help!

Hi, you didn’t post a link to your video.

1 Like

Oh sorry! Just fixed it. Thanks for letting me know!

Maybe you can turn off position smoothing and change the camera offset yourself to have more control over it?

Thanks for the reply. You mean with a script? I could place it offset when the player moves but then snap on the player when they stop. But I don’t know how to make it stop smoothly :confused: