The camera follows smoothly on my screen but lags or jerks on another
A camera that glides after the player at one frame rate trails far behind at another, because the usual smoothing step depends on how often the picture is drawn. A different way of calculating it gives the same movement everywhere. Here is the calculation and a stopping rule.
Why this works
Movement should depend on elapsed time, not on how many pictures were drawn. If the camera closes a share of the gap per second instead of per picture, a fast screen and a slow one show the same motion, and many small steps add up to one big step.
When not to use it
Not needed when the game runs at one fixed rate that you control, such as a console game locked to a single speed, or when the camera should snap hard with no easing. Also wrong for a camera that must follow an exact path, like a cutscene.
In the full entry
- What to build, step by step
- Starting values and the reason for each
- 3 common mistakes and the fix
- 20 lines of example code with 4 checks that pass
- How your AI shows you that it works
Say this to your AI
Use the Spielerando entry "The camera follows smoothly on my screen but lags or jerks on another" (read_entry camera-follow-same-speed-at-any-frame-rate) in my game. Build it step by step, and show me how you checked that it works.Or skip this and connect the MCP: your AI then finds all of this by itself.Connect the MCP