# SetBool

> Sets the value of the given boolean parameter.

## Definition

* **Type:** Method
* **Namespace:** [UnityEngine.Animations](/engine/6000.7/script-reference/unityengine/animations.md)
* **Assembly:** UnityEngine.AnimationModule

## SetBool(string, bool)

Sets the value of the given boolean parameter.

```csharp
public void SetBool(string name, bool value)
```

### Parameters

**** (\[string]\(https\://learn.microsoft.com/dotnet/api/system.string)): The parameter name.**** (\[bool]\(https\://learn.microsoft.com/dotnet/api/system.boolean)): The new parameter value.

### Remarks

Use AnimatorControllerPlayable.SetBool to pass Boolean values to an [Animator Controller](/engine/6000.7/manual/animation-section/animation-mecanim/animation-animator-controller/class-animator-controller.md) via script.

Use this to trigger transitions between states. For example, triggering a death animation by setting an “alive” boolean to false. See documentation on [Animation](/engine/6000.7/manual/animation-section/animation-mecanim/animation-animator-controller/animator-controller-creation.md) for more information on setting up Animators.

Note: You can identify the parameter by name or by ID number, but the name or ID number must be the same as the parameter you want to change in the AnimatorController.

## SetBool(int, bool)

Sets the value of the given boolean parameter.

```csharp
public void SetBool(int id, bool value)
```

### Parameters

**** (\[int]\(https\://learn.microsoft.com/dotnet/api/system.int32)): The parameter ID.**** (\[bool]\(https\://learn.microsoft.com/dotnet/api/system.boolean)): The new parameter value.

### Remarks

Use AnimatorControllerPlayable.SetBool to pass Boolean values to an [Animator Controller](/engine/6000.7/manual/animation-section/animation-mecanim/animation-animator-controller/class-animator-controller.md) via script.

Use this to trigger transitions between states. For example, triggering a death animation by setting an “alive” boolean to false. See documentation on [Animation](/engine/6000.7/manual/animation-section/animation-mecanim/animation-animator-controller/animator-controller-creation.md) for more information on setting up Animators.

Note: You can identify the parameter by name or by ID number, but the name or ID number must be the same as the parameter you want to change in the AnimatorController.
