Skip to main content

Animator.SetBool(string name, boolean value)

Sets the value of the given boolean parameter.

Parameters:

NameTypeDescription
namestringThe parameter name.
valuebooleanThe new parameter value.

Usage

---@type Animator
local animator;

---@type string
local name;

---@type boolean
local value;


animator.SetBool(name, value)

Extra Detail

Use Animator.SetBool to pass Boolean values to an Animator Controller via script.Use this to trigger transitions between Animator states. For example, triggering a death animation by setting an “alive” boolean to false. See documentation on Animation for more information on setting up Animators.