Skip to content

format

typescript
Animator.GetBool(name)

class: Animator

description

Gets the current value of a boolean parameter with the specified parameter name.

parameter

param_nametypedescription
namestringThe name of the parameter.

reture

typedescription
boolean|undefinedTrue if the parameter's current value is successfully retrieved; otherwise, false (returns false when the parameter name is empty or the parameter type is inconsistent).The current value of the parameter.

code example

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