Skip to content

format

typescript
Animator.SetTrigger(name)

class: Animator

description

Set the value of the specified trigger parameter by its name.

parameter

param_nametypedescription
namestringThe name of the parameter.

reture

typedescription
boolean|undefinedReturns true if the parameter is set successfully. Returns false if the parameter name is empty or the parameter type is inconsistent.

code example

typescript
let obj = new GameObject();
let animator = obj.AddComponent<Animator>(Animator);
animator.SetTrigger("trigger0");