natiny.animator.play

Lua
natiny.animator.play(animator, animation [, fade])

Starts a clip from the beginning, optionally cross-fading out of whatever was playing.

Parameters

Name Type Default Description
animator number Animator handle from natiny.animator.create
animation number or string Clip from the model's mesh, by handle or name
fade number 0 Cross-fade duration in seconds; values at or below 0 switch immediately

Example

Lua
natiny.animator.play(hero_legs, "Running", 0.2)
natiny.animator.set_loop(hero_legs, true)

Notes

  • The clip must belong to the same mesh the model was built on; one written against another skeleton is refused.