Skip to main content

Animator.GetCurrentAnimatorStateInfo(number layerIndex)

Returns an AnimatorStateInfo with the information on the current state.

Parameters:

NameTypeDescription
layerIndexnumberThe layer index.

Returns:

typeDescription
AnimatorStateInfoAn 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.