Skip to content

format

typescript
Animator.PlayInFixedTime(name, layer_index, fixed_time_offset)

class: Animator

description

Switches the animation state to the specified animation state and plays it immediately within the specified time.

parameter

param_nametypedescription
namestringThe name of the specified animation state.
layer_indexnumber?The index of the layer.
fixed_time_offsetnumber?The time offset in seconds.

reture

typedescription
void

code example

typescript
let obj = new GameObject();
let animator = obj.AddComponent<Animator>(Animator);
animator.Play("name",0,0);