Skip to content

New: Add easing functions to FunctionScript - #1371

Open
adfriz wants to merge 2 commits into
leezer3:masterfrom
adfriz:easing-function
Open

New: Add easing functions to FunctionScript#1371
adfriz wants to merge 2 commits into
leezer3:masterfrom
adfriz:easing-function

Conversation

@adfriz

@adfriz adfriz commented Aug 1, 2026

Copy link
Copy Markdown
Contributor

Adds lerp, smoothstep and the full set of Robert Penner easing functions (sine, quad, cubic, quart, quint, expo, circ, back, elastic and bounce, each in in/out/inout variants) to the function script API for the animated objects.

Need more test, examples and documentation...

Adds lerp, smoothstep and the full set of Robert Penner easing
functions (sine, quad, cubic, quart, quint, expo, circ, back,
elastic and bounce, each in in/out/inout variants) to the
function script API used by animated objects.
@adfriz

adfriz commented Aug 2, 2026

Copy link
Copy Markdown
Contributor Author
Screen.Recording.2026-08-02.152416.mp4

example, not a proper object to animate but at least easy enough to understand.

Full function list

Function Example Effect
lerp lerp[a, b, t] linear interpolation between two values (t = 0 → a, t = 1 → b)
smoothstep smoothstep[a, b, x] Hermite curve; smooth 0→1, ramps only between a and b
easeinsine easeinsine[t] starts slow, ends fast
easeoutsine easeoutsine[t] starts fast, ends slow
easeinoutsine easeinoutsine[t] slow-fast-slow
easeinquad / easeoutquad / easeinoutquad same pattern quadratic variant
easeincubic / easeoutcubic / easeinoutcubic same pattern cubic variant (most common)
easeinquart / easeoutquart / easeinoutquart same pattern quartic variant
easeinquint / easeoutquint / easeinoutquint same pattern quintic variant
easeinexpo / easeoutexpo / easeinoutexpo same pattern exponential, very aggressive
easeincirc / easeoutcirc / easeinoutcirc same pattern circular curve
easeinback / easeoutback / easeinoutback same pattern overshoots target (pull-back effect)
easeinelastic / easeoutelastic / easeinoutelastic same pattern elastic wobble
easeinbounce / easeoutbounce / easeinoutbounce same pattern bounce (e.g. drop-to-ground)

Example of a bouncy drop:

TranslateYFunction = (1 - easeoutbounce[mod[time, 4] / 4]) * 1.5

Notes

  • Inputs outside 0..1 are not clamped — back/elastic/bounce intentionally exceed the range mid-curve (that's their overshoot).
  • For state-driven animations, use if[...] with a value + delta * speed accumulator; plain mod[time, x] resets abruptly (snaps), so wrap it in min[mod[time, x], x - mod[time, x]] or a cosine carrier if you need continuous motion.ap it in min[mod[time, x], x - mod[time, x]] or a cosine carrier if you need continuous motion.
  • t is usually your formula

@leezer3 what do you think? maybe i should not include the lerp?

@leezer3

leezer3 commented Aug 3, 2026

Copy link
Copy Markdown
Owner

I suspect that lerp is probably actually the most useful of these actually.
slerp might also be useful, but really the limitations of the animated format are going to start hitting when you get really complex- fundamentally at the minute there's no way to chain animation positions.

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

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants