animation.retarget

Section: Animation Groups

What it does

animation.retarget takes targetId, sourceAnim and an options object.

Signature

animation.retarget(targetId, sourceAnim, { boneMap, fixRootPosition })

Arguments

  • targetId
  • sourceAnim
  • { boneMap, fixRootPosition }

    Keys:boneMapfixRootPosition

Example · generated

function start() {  animation.create('main', 'position', 30, 'float');  animation.retarget('main', 1, { boneMap: {}, fixRootPosition: 1 });}

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

22 members in animation