Goodluck / API Reference


The Animate component is used to animate the transform of the entity over time.

Animations are defined as clips using the AnimationClip interface. A clip is a collection of AnimationKeyframes, which define the local translation, rotation and scale of the entity, relative to the parent, as well as the timestamps at which the keyframe is active.

If you want to animate an object defined as a hierarchy of entities, you'll need to add Animate to every child of the hierarchy. Each child should then define its own clips, named consistently across all entities in the hierarchy. A control system can then trigger a clip to play on the root entity.

for (let child_entity of query_down(game.World, entity, Has.Animate)) {
    let child_animate = game.World.Animate[child_entity];
    child_animate.Trigger = "jump";