Skip to content

format

typescript
Animator.CrossFadeInFixedTime(name, normalized_transition_duration, layer_index, fixed_time_offset, fixed_transition_time)

class: Animator

description

Transitions from the current animation state to the target animation state within a specified time.

parameter

param_nametypedescription
namestringThe name of the target animation state.
normalized_transition_durationnumberThe duration of the transition, normalized to the animation length.
layer_indexnumber?The index of the layer.
fixed_time_offsetnumber?The offset time of the state.
fixed_transition_timenumber?The transition time.

reture

typedescription
voidNone

code example

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