Animator
Animator controls imported hard-skinned clips on a GameObject with an
Animator component and valid .skn asset.
| Method | Returns | Description |
|---|---|---|
Animator.Play(gameObjectId, clipName[, loop]) | boolean | Selects the exact clip and restarts it. |
Animator.Stop(gameObjectId) | boolean | Stops skeletal playback. |
Animator.IsPlaying(gameObjectId) | boolean | Reads playback state. |
Animator.GetClip(gameObjectId) | string or nil | Reads the selected clip name. |
Animator.ConsumeFinished(gameObjectId) | string or nil | Consumes one natural non-looping completion. |
function Start(gameObjectId)
Animator.Play(gameObjectId, "Idle", true)
end
function Update(gameObjectId, deltaTime)
local finishedClip = Animator.ConsumeFinished(gameObjectId)
if finishedClip == "Attack" then
Animator.Play(gameObjectId, "Idle", true)
end
end
Looping clips and explicit stops do not create a completion result. A Timeline
or standalone Animation skeletal event may invoke the target's custom
OnSkinAnimationEvent(gameObjectId, loopFlag, clipName, source) function when
playback is triggered; use ConsumeFinished for the later natural completion.
See Skeletal Animation for FBX import, hard-skin rules, topology limits, and matrix budgets.