Skip to main content

PositionAnimation

ecs.PositionAnimation

Description

Animate the position of a target object.

Functions

See component schema.

Schema

PropertyTypeDefaultDescription
target (optional)eid-The target object to animate. If not specified, the animation is run on the object that the component is attached to.
fromobject{0, 0, 0}The starting state of the animation ({x, y, z})
toobject{0, 0, 0}The ending state of the animation ({x, y, z})
autoFrombooleanfalseIf enabled, ignore 'from' property and animate from the state of the object at the start of the animation.
durationnumber1000Length of time that the animation runs in milliseconds.
loopbooleantrueIf enabled, repeat the animation.
reversebooleanfalseWhether to play in reverse, if loop set.
easeInbooleanfalseIf enabled, easing function will be applied over time instead of straight interpolation
easeOutbooleanfalseIf enabled, easing function will be applied over time instead of straight interpolation
easingFunctionstringQuadraticChoose from Quadratic, Cubic, Quartic, Quintic, Sinusoidal, Exponential, Circular, Elastic, Back, and Bounce