Motion
Types
Spring type
type Spring<T> = {
impulse: (self: Graph.Node<T>, delta: T) -> (),
setVelocity: (self: Graph.Node<T>, velocity: T) -> (),
}Properties
NodeToMotion Read Only
Motion.NodeToMotion: { [Graph.Node<any>]: Engine.Spring | Engine.Tween }Color Module
Motion.Color: ColorDataType Module
Motion.DataType: DataTypeEngine Module
Motion.Engine: EngineFunctions
isMotion
Motion.isMotion(obj: unknown): booleanReturns whether the given value is a reactive motion.
spring
Motion.spring<T>(target: T, frequency: number?, damping: number?): Graph.Node<T> & Spring<T>Creates a node that springs toward target, animating any supported value type (numbers, Vector2, UDim2, Color3, …). When target is reactive the spring re-targets on every change, carrying its momentum through. Read the returned node anywhere to subscribe to the live animated value.
Parameters
target: The goal value, static or a reactive node; the spring eases toward it.frequency: Oscillations per second, where higher snaps faster. Defaults to a tuned value; may be reactive.damping: The damping ratio:1is critically damped (no overshoot),<1springs past and settles,>1is sluggish. May be reactive.
tween
Motion.tween<T>(target: T, tweenInfo: TweenInfo?): Graph.Node<T>Creates a node that animates toward target over a fixed duration described by a TweenInfo (easing style, direction, time, repeats). When target or the TweenInfo is reactive the tween restarts toward the new goal. Read the returned node to subscribe to the live animated value. Prefer a Flux.spring for momentum-driven, interruptible motion.
step from Engine
Motion.step(now: number?)Advances every active spring and tween by one frame. Wired automatically to each RunService.Heartbeat under Roblox, so you rarely call it yourself; drive it manually only when stepping motion deterministically in tests.