Skip to content

Api > Animator > PlayInFixedTime()


Animator.PlayInFixedTime(string stateName, number layer = -1, number fixedTime = -#INF)⚓︎

Plays a state.

Parameters:⚓︎

Name Type Description
stateName string The state name.
layer number The layer index. If layer is -1, it plays the first state with the given state name or hash.
fixedTime number The time offset (in seconds).

Usage⚓︎

---@type Animator
local animator;

---@type string
local stateName;

---@type number
local layer;

---@type number
local fixedTime;


animator.PlayInFixedTime(stateName, layer, fixedTime)

Extra Detail⚓︎

When you specify a state name, or the string used to generate a hash, it should include the name of the parent layer. For example, if you have a Run state in the Base Layer, the name is Base Layer.Run.