Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Camera2D with smoothing enabled has intermittent position 'jumps' #68394

Closed
compmstr opened this issue Nov 8, 2022 · 5 comments
Closed

Camera2D with smoothing enabled has intermittent position 'jumps' #68394

compmstr opened this issue Nov 8, 2022 · 5 comments

Comments

@compmstr
Copy link
Contributor

compmstr commented Nov 8, 2022

Godot version

v4.0.beta4.official [e675154]

System information

Linux (Pop OS), NVIDIA GeForce RTX 2060, Video Drive v 470.141.03

Issue description

When I have the current Camera2D as the child of a CharacterBody2D, with smoothing enabled, the camera appears to jerk noticeably while moving.

Enabling 'Movie Maker Mode' appears to clear up the issue, as well as turning smoothing off on the Camera2D node.

The jumps appear to be proportional to the amount of smoothing enabled, so smaller smoothing speeds cause smaller shifts.

Steps to reproduce

  • Set up a CharacterBody2D with the default script
  • Set a Camera2D as the child of the CharacterBody2D
  • Set the camera to current
  • Set position smoothing on the camera to true
  • Set the position smoothing speed on the camera to a sufficiently high value (say, 50px/sec)

That's enough to reproduce, just having the character falling will show the jitter.
It also jitters on regular side to side / and jumping movement.

Minimal reproduction project

Smooth Camera Jitter Repro.zip

This has a small platform set up, and the camera smoothing set to 50px/sec.
It also has a small sample video of the behavior.

@Calinou
Copy link
Member

Calinou commented Nov 8, 2022

This is expected due to the lack of physics interpolation. The camera is smoothed in process, but the character is moved in physics process. Use https://github.com/lawnjelly/smoothing-addon/tree/4.x to resolve this until physics interpolation is added to core (and in 2D). Alternatively, set the Camera2D's update mode to Physics, but this will look less smooth on high refresh rate monitors and will cause jittering to occur if there are FPS drops below the physics update rate (60 by default).

Movie Maker mode hides this issue by making the process rate the exact same as the physics FPS.

@compmstr
Copy link
Contributor Author

compmstr commented Nov 8, 2022

Thank you for the explanation, that makes sense. Should I close this issue?

@Calinou
Copy link
Member

Calinou commented Nov 8, 2022

Thank you for the explanation, that makes sense. Should I close this issue?

Yes 🙂

@Calinou Calinou closed this as not planned Won't fix, can't repro, duplicate, stale Nov 8, 2022
@Xinart
Copy link

Xinart commented May 23, 2023

I have this issue in Godot v4.0.3
Solved as mentionned @Calinou the Camera2D's update mode to Physics as you can see

Animation

Godot version
Godot Engine v4.0.3.stable.official.5222a99f5
System information
Windows 10, NVIDIA GeForce RTX 3060 Ti ( Vulkan API 1.3.205 - Forward+ - Using Vulkan Device #0: NVIDIA - )

@dat-Koriel
Copy link

I have this issue in Godot v4.0.3 Solved as mentionned @Calinou the Camera2D's update mode to Physics as you can see

Animation

Godot version Godot Engine v4.0.3.stable.official.5222a99f5 System information Windows 10, NVIDIA GeForce RTX 3060 Ti ( Vulkan API 1.3.205 - Forward+ - Using Vulkan Device #0: NVIDIA - )

Having the same issue over here, using Godot v4.0.3.stable.official [5222a99].

Just in case it's useful for me to report it as well.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

No branches or pull requests

4 participants