RUSTICDOCSSearch documentation

Smooth and Interpolation

Evaluate interpolation and damping immediately without scheduling an action.

Feature status and language/platform compatibility

Choose an API to see its signature, parameters, examples and behavior.

APIs

Module guide

Setup and language support

These engine-owned services work in Lua 5.4, Luau, JavaScript, Python, C, C++, C#, Java, PHP, and HTML inline JavaScript. Follow Use gameplay actions to create and attach a script, install external toolchains, and choose the correct language binding. PHP and HTML scripts belong under ui/; CSS alone runs no gameplay code.

The Calls section uses JavaScript signatures. The function examples below include native syntax for all ten script types, including SDK-specific alternatives and limitations. Attach a JavaScript Object Component script to the specified target and press Play. Globals are supplied by the engine. Schedule actions from Start or a callback, rather than at script top level. Native languages use typed options and their own builder conventions; see the guide's language bindings.

Parameters

Lerp accepts scalars or three-component vectors. Slerp accepts nonzero [x, y, z, w] quaternions. Progress and inputs must be finite. Easing defaults to Linear. SmoothDamp takes scalar state, a smoothing time and elapsed seconds; feed the returned velocity into the next call.

Return and timing

Math results are synchronous. JavaScript smoothDamp returns {value, velocity}; native return shapes differ (for example C# tuple and Java double[2]). Interpolation aliases Smooth in Lua, Luau, JavaScript, Python, C, C++, PHP and HTML inline JavaScript. C# and Java expose these functions through Smooth.

Behavior and limitations

  • This example prints interpolated values immediately in Start; it creates no operation handle.
  • InverseLerp and remap do not clamp out-of-range values. A degenerate input interval returns inverse progress zero (and remap returns outMin). Damping uses an analytic spring rather than a fixed per-frame fraction.
  • Use Tween.value or Animation.value when you want the engine to advance interpolation and dispatch callbacks over time.
  • Check script attachment, enabled state and the Console when an operation fails. Asynchronous errors also appear in operation state. Callback exceptions disable the owner and clean up its actions.
  • Owner destruction, disable, successful reload or Stop cleans up owned actions and subscriptions. Failed reload retains the previous behavior's operations. See Operation handles for controls and lifetime details.