# AnimatorControllerParameter

> Used to communicate between scripting and an AnimatorController.

## Definition

* **Type:** Class
* **Namespace:** [UnityEngine](/engine/6000.5/script-reference/unityengine.md)
* **Assembly:** UnityEngine.AnimationModule

```csharp
public class AnimatorControllerParameter
```

## Remarks

You can add an [AnimatorControllerParameter](/engine/6000.5/script-reference/unityengine/animatorcontrollerparameter.md) to an [AnimatorController](/engine/6000.5/script-reference/unityeditor/animations/animatorcontroller.md) in the Animator window or with the function [AnimatorController.AddParameter](/engine/6000.5/script-reference/unityeditor/animations/animatorcontroller/addparameter.md) in script. At runtime, use the following functions to set the value of a parameter in the [Animator](/engine/6000.5/script-reference/unityengine/animator.md):

* [Animator.SetBool](/engine/6000.5/script-reference/unityengine/animator/setbool.md)
* [Animator.SetFloat](/engine/6000.5/script-reference/unityengine/animator/setfloat.md)
* [Animator.SetInteger](/engine/6000.5/script-reference/unityengine/animator/setinteger.md)
* [Animator.SetTrigger](/engine/6000.5/script-reference/unityengine/animator/settrigger.md)

You can also set parameter values in the Animation window based on Animation Curves in Animation Clips.

```csharp
using UnityEditor;
using UnityEditor.Animations;
using UnityEngine;

// This example demonstrates how to create an AnimatorController with some default parameters.
public static class AnimatorControllerParameterExample
{
    [MenuItem("Example/Create Animator Controller With Default Parameters")]
    public static void CreateAnimatorControllerWithDefaultParameters()
    {
        // Create a new AnimatorController.
        var controller = AnimatorController.CreateAnimatorControllerAtPath("Assets/NewControllerWithParameters.controller");

        // Add a new parameter to the controller.
        var speedParameter = new AnimatorControllerParameter
        {
            name = "Speed",
            type = AnimatorControllerParameterType.Float
        };
        controller.AddParameter(speedParameter);

        // Add another parameter to the controller with a default value.
        var isGroundedParameter = new AnimatorControllerParameter
        {
            name = "IsGrounded",
            type = AnimatorControllerParameterType.Bool,
            defaultBool = true
        };
        controller.AddParameter(isGroundedParameter);

        // Save the controller.
        AssetDatabase.SaveAssetIfDirty(controller);
    }
}
```

Additional Resources: [AnimationParameters](/engine/6000.5/manual/animation-section/animation-mecanim/animation-animator-controller/animation-state-machines/animation-parameters.md) manual. [AnimatorController.RemoveParameter](/engine/6000.5/script-reference/unityeditor/animations/animatorcontroller/removeparameter.md) for removing parameters. [AnimatorController.parameters](/engine/6000.5/script-reference/unityeditor/animations/animatorcontroller/parameters.md) for accessing the list of parameters.

## Properties

| Property                                                                                                | Description                                          |
| ------------------------------------------------------------------------------------------------------- | ---------------------------------------------------- |
| [defaultBool](/engine/6000.5/script-reference/unityengine/animatorcontrollerparameter/defaultbool.md)   | The default bool value for the parameter.            |
| [defaultFloat](/engine/6000.5/script-reference/unityengine/animatorcontrollerparameter/defaultfloat.md) | The default float value for the parameter.           |
| [defaultInt](/engine/6000.5/script-reference/unityengine/animatorcontrollerparameter/defaultint.md)     | The default int value for the parameter.             |
| [name](/engine/6000.5/script-reference/unityengine/animatorcontrollerparameter/name.md)                 | The name of the parameter.                           |
| [nameHash](/engine/6000.5/script-reference/unityengine/animatorcontrollerparameter/namehash.md)         | Returns the hash of the parameter based on its name. |
| [type](/engine/6000.5/script-reference/unityengine/animatorcontrollerparameter/type.md)                 | The type of the parameter.                           |
