Skip to content

Api > Animator > GetCurrentAnimatorStateInfo()


Animator.GetCurrentAnimatorStateInfo(number layerIndex)⚓︎

Returns an AnimatorStateInfo with the information on the current state.

Parameters:⚓︎

Name Type Description
layerIndex number The layer index.

Returns:⚓︎

type Description
AnimatorStateInfo An AnimatorStateInfo with the information on the current state.

Usage⚓︎

---@type Animator
local animator;

---@type number
local layerIndex;


local val0 = animator.GetCurrentAnimatorStateInfo(layerIndex)

Extra Detail⚓︎

Fetches the data from the current state in the Animator. Use this to get details from the state, including accessing the state’s speed, length, name and other variables. For gathering information from the clips that the states hold, see Animator.GetCurrentAnimatorClipInfo.