Skip to content

Class: AnimatorComponent ​

Runs an animation graph (.animgraph asset) on the entity's AnimationComponent: plays the entry state's clip, then follows transitions as parameters change and clips reach their exit times. Gameplay code drives it through the parameters:

animator.SetBool('running', true);
animator.SetTrigger('jump');

AnimatorSystem does the work (Update phase, before AnimationSystem). The AnimationComponent's own Play On Load should be off — the graph decides what plays.

Extends ​

Constructors ​

Constructor ​

ts
new AnimatorComponent(): AnimatorComponent;

Returns ​

AnimatorComponent

Inherited from ​

Component.constructor

Properties ​

PropertyModifierTypeDefault valueInherited from
dirtypublicbooleantrueComponent.dirty
enabledpublicbooleantrueComponent.enabled
graphpublicstringundefined-

Methods ​

GetBool() ​

ts
GetBool(name): boolean;

Parameters ​

ParameterType
namestring

Returns ​

boolean


GetCurrentState() ​

ts
GetCurrentState(): string | null;

Returns ​

string | null


GetNumber() ​

ts
GetNumber(name): number;

Parameters ​

ParameterType
namestring

Returns ​

number


IsInState() ​

ts
IsInState(name): boolean;

Parameters ​

ParameterType
namestring

Returns ​

boolean


OnStateEnter() ​

ts
OnStateEnter(cb): AnimatorUnsubscribe;

Parameters ​

ParameterType
cb(state, previous) => void

Returns ​

AnimatorUnsubscribe


Play() ​

ts
Play(state): void;

Jumps straight to a state (next tick), skipping transitions.

Parameters ​

ParameterType
statestring

Returns ​

void


ResetTrigger() ​

ts
ResetTrigger(name): void;

Parameters ​

ParameterType
namestring

Returns ​

void


SetBool() ​

ts
SetBool(name, value): void;

Parameters ​

ParameterType
namestring
valueboolean

Returns ​

void


SetNumber() ​

ts
SetNumber(name, value): void;

Parameters ​

ParameterType
namestring
valuenumber

Returns ​

void


SetTrigger() ​

ts
SetTrigger(name): void;

Held until a transition consumes it (or ResetTrigger).

Parameters ​

ParameterType
namestring

Returns ​

void

© 2026 PlayAdGentic