animation.playState

Section: Animator State Machine

What it does

animation.playState plays State on an animation object. It takes entityId, state and layer. layer is optional.

Signature

animation.playState(entityId, state, layer?)

Arguments

  • entityId
  • state
  • layeroptional

Example · generated

function start() {  animation.create('main', 'position', 30, 'float');  animation.playState('main', 'idle');}

animation.create is there to give the call something to act on; animation.playState is the line that matters. The code sits in start(), which the engine calls once, when the entity spawns.

22 members in animation