PositionAnimation
ecs.PositionAnimation
Description
Animate the position of a target object.
Functions
See component schema.
Schema
Property | Type | Default | Description |
---|---|---|---|
target (optional) | eid | - | The target object to animate. If not specified, the animation is run on the object that the component is attached to. |
from | object | {0, 0, 0} | The starting state of the animation ({x, y, z} ) |
to | object | {0, 0, 0} | The ending state of the animation ({x, y, z} ) |
autoFrom | boolean | false | If enabled, ignore 'from' property and animate from the state of the object at the start of the animation. |
duration | number | 1000 | Length of time that the animation runs in milliseconds. |
loop | boolean | true | If enabled, repeat the animation. |
reverse | boolean | false | Whether to play in reverse, if loop set. |
easeIn | boolean | false | If enabled, easing function will be applied over time instead of straight interpolation |
easeOut | boolean | false | If enabled, easing function will be applied over time instead of straight interpolation |
easingFunction | string | Quadratic | Choose from Quadratic , Cubic , Quartic , Quintic , Sinusoidal , Exponential , Circular , Elastic , Back , and Bounce |