Skip to content

What is a spring?

A spring moves a value towards a target, a little bit every frame, and keeps doing it forever. You never tell it how long to take or which curve to follow. You set a target, and two numbers decide how it gets there.

That is the whole idea. The rest of this manual is about which value you spring and how you talk to it from a script.

// A health bar. No coroutine, no duration, no easing curve.
uiSliderSpring.SetTarget(currentHp / maxHp);

Change that target mid-motion and nothing breaks. The spring is already moving, it simply starts heading somewhere else from wherever it is, at whatever speed it had. There is no animation to cancel first and no state of yours to reset.

Any number. Position, rotation and scale are the obvious ones, but the toolkit also ships components for camera field of view, light intensity, audio volume and pitch, colours, UI anchored position, slider values and named shader floats. If none of those fit, a raw FloatSpringComponent or Vector3SpringComponent runs a spring for you and lets your own code decide what to do with the result.

Every moving thing in the demo scene is a spring, which makes it the fastest way to see what this feels like in practice.