Skip to main content

Animator

Animator controls imported hard-skinned clips on a GameObject with an Animator component and valid .skn asset.

MethodReturnsDescription
Animator.Play(gameObjectId, clipName[, loop])booleanSelects the exact clip and restarts it.
Animator.Stop(gameObjectId)booleanStops skeletal playback.
Animator.IsPlaying(gameObjectId)booleanReads playback state.
Animator.GetClip(gameObjectId)string or nilReads the selected clip name.
Animator.ConsumeFinished(gameObjectId)string or nilConsumes 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.