Skip to content

format

typescript
Animator.SetInteger(name, value)

class: Animator

description

Sets the current value of the integer type parameter with the specified parameter name.

parameter

param_nametypedescription
namestringThe name of the parameter.
valuenumberThe 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.SetInteger("int0",0);