---
title: RigBuilder
product: Unity Editor
version: '7000.0'
latest_version: '7000.0'
status: This page documents version 7000.0. The latest version is 7000.0.
canonical: https://docs.unity.com/en-us/engine/7000.0/script-reference/unity/animations/rigbuilder
latest_url: https://docs.unity.com/en-us/engine/7000.0/script-reference/unity/animations/rigbuilder.md
last_updated: 2026-11-30
generated_at: 2026-11-30T20:43:09.666Z
locale: en-us
---

# RigBuilder

> An intermediate data representing the rig.

## Definition

* **Type:** Struct
* **Namespace:** [Unity.Animations](/engine/7000.0/script-reference/unity/animations.md)
* **Assembly:** [UnityEngine.AnimationCoreModule](/engine/7000.0/script-reference/modules/unityengine-animationcoremodule.md)
* **Implements:** [IDisposable](https://learn.microsoft.com/dotnet/api/system.idisposable)

```csharp
[BurstCompile]
public struct RigBuilder : IDisposable
```

## Remarks

If you don't use the Skeleton but your own custom rig representation, as long as you have a method to convert this representation to a RigBuilder, we can build a RigDefinition from it.

The following example uses the `Unity.Animations`, `Unity.Collections`, `Unity.Entities`, `Unity.Mathematics`, and `UnityEngine` namespaces. It builds a rig definition with three bones and one float channel.

Additional Resources: [RigDefinition](/engine/7000.0/script-reference/unity/animations/rigdefinition.md), [BindingSet](/engine/7000.0/script-reference/unity/animations/bindingset.md)

## Examples

```csharp
// This example builds a rig definition for a three-bone character with one float channel.
// The caller owns the returned rig definition and must dispose it.
public static BlobObjectReference<RigDefinition> BuildCharacterRig()
{
    using RigBuilder rigBuilder = new RigBuilder(Allocator.Temp);

    // Add the bones. Add the parent of a bone before the bone itself.
    // The root bone has a ParentIndex of -1.
    rigBuilder.Add(new SkeletonNode
    {
        Id = "Root",
        ParentIndex = -1,
        LocalTranslationDefaultValue = float3.zero,
        LocalRotationDefaultValue = quaternion.identity,
        LocalScaleDefaultValue = new float3(1f)
    });
    rigBuilder.Add(new SkeletonNode
    {
        Id = "Spine",
        ParentIndex = 0,
        LocalTranslationDefaultValue = new float3(0f, 1f, 0f),
        LocalRotationDefaultValue = quaternion.identity,
        LocalScaleDefaultValue = new float3(1f)
    });
    rigBuilder.Add(new SkeletonNode
    {
        Id = "Head",
        ParentIndex = 1,
        LocalTranslationDefaultValue = new float3(0f, 0.5f, 0f),
        LocalRotationDefaultValue = quaternion.identity,
        LocalScaleDefaultValue = new float3(1f)
    });

    // Add a float channel that animation can write to. The channel is the intensity of a light on the Head bone.
    // Clips find the channel through the identifier that FloatChannel.Create computes from the transform path
    // and the property name. The property name is the serialized name m_Intensity, not intensity. The last
    // argument is the default value of the channel.
    rigBuilder.Add(FloatChannel.Create("Root/Spine/Head", typeof(Light), "m_Intensity", 1f));

    // Create the immutable rig definition. The result has three bones and one float channel.
    return rigBuilder.ToRigDefinition();
}
```

## Constructors

| Constructor                                                                                                    | Description             |
| -------------------------------------------------------------------------------------------------------------- | ----------------------- |
| [RigBuilder(Unity.Collections.Allocator)](/engine/7000.0/script-reference/unity/animations/rigbuilder/ctor.md) | RigBuilder constructor. |

## Properties

| Property                                                                                            | Description                                                              |
| --------------------------------------------------------------------------------------------------- | ------------------------------------------------------------------------ |
| [IsCreated](/engine/7000.0/script-reference/unity/animations/rigbuilder/iscreated.md)               | Returns true if the RigBuilder has been properly created.                |
| [RootMotionBoneId](/engine/7000.0/script-reference/unity/animations/rigbuilder/rootmotionboneid.md) | The identifier of the bone whose motion gives the root motion of a clip. |

## Methods

| Method                                                                                                                      | Description                                                                |
| --------------------------------------------------------------------------------------------------------------------------- | -------------------------------------------------------------------------- |
| [Add](/engine/7000.0/script-reference/unity/animations/rigbuilder/add.md)                                                   | Adds an EntityIdChannel to the RigBuilder.                                 |
| [Clear](/engine/7000.0/script-reference/unity/animations/rigbuilder/clear.md)                                               | Clears all RigBuilder channels.                                            |
| [Dispose](/engine/7000.0/script-reference/unity/animations/rigbuilder/dispose.md)                                           | Disposes the RigBuilder.                                                   |
| [GetBoneIndex](/engine/7000.0/script-reference/unity/animations/rigbuilder/getboneindex.md)                                 | Finds the index of the skeleton node that has an identifier.               |
| [Remove](/engine/7000.0/script-reference/unity/animations/rigbuilder/remove.md)                                             | Removes the entity ID channels that have the same identifier as a channel. |
| [Replace](/engine/7000.0/script-reference/unity/animations/rigbuilder/replace.md)                                           | Replaces the entity ID channel that has the same identifier as a channel.  |
| [ToRigDefinition](/engine/7000.0/script-reference/unity/animations/rigbuilder/torigdefinition.md)                           | Creates a RigDefinition from the current RigBuilder data.                  |
| [TryGet](/engine/7000.0/script-reference/unity/animations/rigbuilder/tryget.md)                                             | Gets the skeleton node at a bone index.                                    |
| [TrySetBoneDefaultRotation](/engine/7000.0/script-reference/unity/animations/rigbuilder/trysetbonedefaultrotation.md)       | Sets the default rotation of the bone at a bone index.                     |
| [TrySetBoneDefaultScale](/engine/7000.0/script-reference/unity/animations/rigbuilder/trysetbonedefaultscale.md)             | Sets the default scale of the bone at a bone index.                        |
| [TrySetBoneDefaultTranslation](/engine/7000.0/script-reference/unity/animations/rigbuilder/trysetbonedefaulttranslation.md) | Sets the default translation of the bone at a bone index.                  |
| [TrySetDefaultEntityId](/engine/7000.0/script-reference/unity/animations/rigbuilder/trysetdefaultentityid.md)               | Sets the default value of the entity ID channel that has an identifier.    |
| [TrySetDefaultFloat](/engine/7000.0/script-reference/unity/animations/rigbuilder/trysetdefaultfloat.md)                     | Sets the default value of the float channel that has an identifier.        |
| [TrySetDefaultInt](/engine/7000.0/script-reference/unity/animations/rigbuilder/trysetdefaultint.md)                         | Sets the default value of the integer channel that has an identifier.      |
| [TrySetDefaultRotation](/engine/7000.0/script-reference/unity/animations/rigbuilder/trysetdefaultrotation.md)               | Sets the default value of the rotation channel that has an identifier.     |
| [TrySetDefaultScale](/engine/7000.0/script-reference/unity/animations/rigbuilder/trysetdefaultscale.md)                     | Sets the default value of the scale channel that has an identifier.        |
| [TrySetDefaultTranslation](/engine/7000.0/script-reference/unity/animations/rigbuilder/trysetdefaulttranslation.md)         | Sets the default value of the translation channel that has an identifier.  |

## Static Methods

| Method                                                                          | Description                             |
| ------------------------------------------------------------------------------- | --------------------------------------- |
| [Create](/engine/7000.0/script-reference/unity/animations/rigbuilder/create.md) | Create RigBuilder from an Avatar asset. |
