Skip to content

format

typescript
Animator.SetBool(name, value)

class: Animator

description

Sets the current value of the specified boolean parameter.

parameter

param_nametypedescription
namestringThe name of the parameter.
valuebooleanThe value 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.SetBool("bool0",true);