Let a move end exactly on its goal and pass spare time to the next one
Chained moves often stop a hair short, overshoot on a slow frame, or lose a little time at every join so a sequence drifts out of sync with the music. Here is how to make each step land cleanly and hand over what it did not use.
Why this works
Time is the one thing that must never be lost or counted twice. Measuring how long a step has run, instead of adding up little pieces, keeps rounding from creeping in, and handing the spare time to the next step means a slow frame shifts nothing down the line.
When not to use it
Don't use it for movement that reacts to the player while it runs, such as a camera following a moving target, or for effects that simply loop without an end. A fixed start, end and length are what make this fit.
In the full entry
- What to build, step by step
- Starting values and the reason for each
- 3 common mistakes and the fix
- A diagram of every state
- 45 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 "Let a move end exactly on its goal and pass spare time to the next one" (read_entry tween-ends-exactly-and-passes-leftover-time) 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