Skip to content

Api > Animator > SetInteger()


Animator.SetInteger(string name, number value)⚓︎

Sets the value of the given integer parameter.

Parameters:⚓︎

Name Type Description
name string The parameter name.
value number The new parameter value.

Usage⚓︎

---@type Animator
local animator;

---@type string
local name;

---@type number
local value;


animator.SetInteger(name, value)

Extra Detail⚓︎

Use this as a way to trigger transitions between Animator states. One way of using Integers instead of Floats or Booleans is to use it for something that has multiple states, for example directions (turn left, turn right etc.). Each direction could correspond to a number instead of having multiple Booleans that have to be reset each time.