Skip to content

[SmoothCamera] Camera shaking at 120fps #1650

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

Closed
1 task done
timotheeficat opened this issue Apr 11, 2025 · 2 comments
Closed
1 task done

[SmoothCamera] Camera shaking at 120fps #1650

timotheeficat opened this issue Apr 11, 2025 · 2 comments
Labels
⚠ Issue with an extension An issue with an extension that is already on the extension store

Comments

@timotheeficat
Copy link

Is there an existing issue for this?

Enter the name of the extension

SmoothCamera

Describe the bug of the extension

The SmoothCamera extensions seems to have issues when the game is running at 120fps.
The camera is shaking a bit, causing the tracked object to be blurry.
The issue totally disappear when running at 60 fps.

Image

The gif can't run fast enough but we can still see the spaceship shaking at each frame.

This is my extension settings :

Image

And this is the only line I use to move my camera :

Image

To note :

  • My screen is 144Hz, the game says it's running at 120fps.
  • I have a second screen which is 60Hz. The issue disappear when I move the game window onto it but the game is still saying that it's running at 120fps.

Steps to reproduce

  1. Setup a SmoothCamera behaviour on an object
  2. Make the object translate fast enough
  3. Run the game on a 120+ fps screen without maximum fps limitation

GDevelop platform

Desktop

GDevelop version

5.5.228

Platform info

OS (e.g. Windows, Linux, macOS, Android, iOS)

Windows

OS Version (e.g. Windows 10, macOS 10.15)

Windows 11, same issue on Windows 10

Additional context

No response

@timotheeficat timotheeficat added the ⚠ Issue with an extension An issue with an extension that is already on the extension store label Apr 11, 2025
@D8H
Copy link
Contributor

D8H commented Apr 12, 2025

The 2D physics behavior runs at a maximum of 60fps for reproducibility reason (I’m not saying it’s a good choice or not). So at 120 fps, the world move once every 2 frames whereas the camera moves every frame. This why the spaceship appears to shake.

In short, it’s not an issue of the smooth camera, it’s an issue in the 2D physics. As a workaround, you can limit the game at 60 fps since physics won’t run at more than 60 fps anyway.

@timotheeficat
Copy link
Author

timotheeficat commented Apr 13, 2025

Alright that make sense.
I'm sorry the only hint I used the physic engine was the code line screenshot!
I remember an action that ask the physic engine to update on demand but I can't find it.
So I guess I can interpolate the position of the camera target between physics updates, I'll see how it goes.
Thank you for your answer!

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
⚠ Issue with an extension An issue with an extension that is already on the extension store
Projects
None yet
Development

No branches or pull requests

2 participants