# Auto Rig Chest Documentation

**EDIT: The tool has been deprecated and can no longer be downloaded.**

## ❓ What is Auto Rig Chest

Auto Rig Chest is a Unity Editor script designed to create rigged model versions of existing chests, footlockers, trunks, and similar container objects, making them compatible with [**Treasure Chest Animations**](https://assetstore.unity.com/packages/3d/animations/treasure-chest-animations-302117).

## ✍ Prerequisites

Not all models are compatible with Auto Rig Chest. Only models that have its **base** mesh and **lid** mesh as **separate** objects can be used.

<div><figure><img src="/files/6n5sTVnoe1TLMZBaRtZZ" alt=""><figcaption><p>✅ Base and lid are separated objects: <strong>Compatible</strong>.</p></figcaption></figure> <figure><img src="/files/YnmP8Zh1XhUsQhjVG8J4" alt=""><figcaption><p>❌ All meshes are in the same object (Chest): <strong>Not compatible</strong>.</p></figcaption></figure></div>

## 📂 How to open it

To access the script, navigate to the Unity Editor top menu bar:\
**Tools > Kevin Iglesias > Auto Rig Chest**

<figure><img src="/files/aFU6bM2HhJmOJuB4wjKE" alt=""><figcaption></figcaption></figure>

## 📋 Instructions

For this example, this chest will be used:\
Treasure Chest - AKU (<https://assetstore.unity.com/packages/3d/props/treasure-chest-aku-88449>)

<figure><img src="/files/8Jg4RdqO7oV8s2n1MKqB" alt=""><figcaption></figcaption></figure>

When you open the window, you'll see a step-by-step guide (1 to 5) along with some fields and buttons.

<figure><img src="/files/m4C0zHpIJoPtRy4XkUaN" alt="" width="375"><figcaption></figcaption></figure>

The Auto Rig Chest window is dockable, like other Unity Editor windows.

If you see this message: '**\[✘] Template rig source model not found in project.'** (as shown in the image below), reimport the script and ensure that the **TreasureChestTemplateRig** file, located in the same folder as the **AutoRigChest.cs** script, is also imported.

<figure><img src="/files/3S3jYw8Xr59DAsREERWL" alt="" width="375"><figcaption></figcaption></figure>

**Step 1.**\
**Drop template rig source model to your scene.**

First, we need to put the source template rig model (**TreasureChestTemplateRig**) in our scene at the same position we have the chest we want to rig.

{% hint style="info" %}
It is recommnended to create a new empty scene and place both the **TreasureChestTemplateRig** and the chest you want to rig at the scene's center (0, 0, 0) position.
{% endhint %}

<figure><img src="/files/VlVVFYMrvLxXMSmF0mVm" alt=""><figcaption><p>Clicking on the first field of the TreasureChestTemplateRig will take you to its project location, allowing you to easily drag and drop it into the scene.</p></figcaption></figure>

**Step 2.**\
**Assign the template rig source model from your scene to this field:**

After dropping the **TreasureChestTemplateRig** in our scene we must assign it to the field in this step. Remember this must be at the same location of our chest to be modified.

<div><figure><img src="/files/DwPIthRCPHXyaSJRvSnk" alt=""><figcaption><p>Our treasure chest.</p></figcaption></figure> <figure><img src="/files/pzxEB6s2sNuP8xsdMjIj" alt=""><figcaption><p>Our treasure chest with the TreasureChestTemplateRig in the same position.</p></figcaption></figure></div>

<figure><img src="/files/hxUP2TTtzabG2en17Ibx" alt="" width="563"><figcaption><p>We assign the TreasureChestTemplateRig from our scene in this field.</p></figcaption></figure>

**Step 3.**\
**Locate and assign mesh game objects of your chest:**

In this step we must locate the base and lid mesh of our chest and assign them to each Chest Base and Chest Lid fields in the Auto Rig Window.

<figure><img src="/files/9D2yImTemKoazqhdAhG3" alt=""><figcaption><p>Assigning the <strong>base</strong> mesh (sometimes called bottom) to its field in step 3.</p></figcaption></figure>

<figure><img src="/files/q7Ex6UUUC6R4GRL5RZlS" alt=""><figcaption><p>Assigning the <strong>lid</strong> mesh (sometimes called top) to its field in step 3.</p></figcaption></figure>

**Step 4.**\
**Place template rig at your chest and match bones to your chest parts.**

We should already have our template rig model at the same position of our chest. Now we must make each part of it match the corresponding parts of our chest.

It is important that we start adjusting the bones in order. First we adjust the 'B-back' bone from the template rig to the back part of our chest. Like in these images:

<div><figure><img src="/files/BwZ4UOuJiUaIwKM4sepA" alt=""><figcaption></figcaption></figure> <figure><img src="/files/hEgbgzKPjiZ8l7mihg1t" alt=""><figcaption></figcaption></figure></div>

Then, we do the same but for the front of the chest, moving the 'B-front' bone.

<figure><img src="/files/jyTTWe89F8FUDGdYDPY8" alt=""><figcaption></figcaption></figure>

And for both sides, adjusting the left side first ('B-leftSide'):

<figure><img src="/files/IKYi7FUGHi0l4KnZOARP" alt=""><figcaption></figcaption></figure>

After adjusting the sides (back, front, left and right) we can now adjust the **lid**. The lid must match the chest lid position and rotation. The position must be right where the hinge center should be. And if the lid of our chest is closed, we must adjust the template rig lid to be closed too.

<figure><img src="/files/zvtyEB8LalwUPp5Cb6mf" alt=""><figcaption><p>Adjusting the lid position.</p></figcaption></figure>

<div><figure><img src="/files/DX4PPXx5iQG9P0NarOMO" alt=""><figcaption><p>Rotating the template lid to match the chest lid.</p></figcaption></figure> <figure><img src="/files/Qg4QHB4hLxe0B9Or0X1H" alt=""><figcaption><p>In this case, the template lid was rotated 90º to fit the close state of the chest lid.</p></figcaption></figure></div>

If your chest also have handles (and they are separate meshes from the base) they can also be rigged and animated. Match each B-handle to their side, and rotate them accordingly.

**Step 5.**\
**Give a name and set export file path:**

<figure><img src="/files/OgnXEOxWjU1FMtX55A0o" alt="" width="375"><figcaption></figcaption></figure>

After adding a name we will be able to use the 'Create Chest Rig' button that will create our new chest.\
The default path is 'CreatedChests' folder inside the same folder of the '**AutoRigChest.cs**' script but you can change it by pressing the button with the three dots at the end of the path field. This path can only be a path inside the Assets folder of the current Unity project.

After we press 'Create Chest Rig' we will see a new generated chest in our scene:

<figure><img src="/files/GKzFdJGHj29XjVGJ6zX6" alt="" width="563"><figcaption><p>Our new chest generated by Auto Rig Chest, with the same rig as the <strong>TreasureChestTemplateRig</strong>.</p></figcaption></figure>

This new chest will be able to play [**Treasure Chest Animations**](https://assetstore.unity.com/packages/3d/animations/treasure-chest-animations-302117). It is a prefab using new mesh files, so it works independently of the original chest asset files. But it will still be using the materials assigned to its parts when created. If you want to use this prefab in other projects, don't forget to copy or move the materials to the same folder.&#x20;

{% hint style="info" %}
A quick way to get to the folder of our new chest is to right click on its name on the hierarchy from our scene, then select '**Prefab**' and then '**Select Asset'**. This will change the directory of our Unity Project window to the path with our new rigged chest files:

#### <img src="/files/66pY4oNA6AbpRtOkve9O" alt="" data-size="original">      ![](/files/KYUROC1K4nP3JEwvKHNp)

{% endhint %}

<figure><img src="/files/Ozmah9aZoMGjVjfaVjlq" alt="" width="563"><figcaption><p>Add the Animator Controller from Treasure Chest Animations to the created rigged chest.</p></figcaption></figure>

You can then drag the same '**TreasureChest**' Animator Controller to the new prefab chest and it will play the same animations as the example models of [**Treasure Chest Animations**](https://assetstore.unity.com/packages/3d/animations/treasure-chest-animations-302117) like in this video:

{% embed url="<https://www.keviniglesias.com/videos/AutoRigChestExample01.mp4>" %}

## 📦 Exporting outside of Unity

You can export the rigged model for use in other game engines along with the animations. The animations are already in FBX file format and can be read by most of game engines. For the rigged chests made by Auto Rig Chest you can use the Unity FBX Exporter package. To install it you must open the Package Manager. To access it, navigate to the Unity Editor top menu bar:\
**Window > Package Manager**

Then select Unity Registry packages and use type 'fbx' in the search bar.

<figure><img src="/files/2JAwJ8pUfammFyG5G2IG" alt=""><figcaption></figcaption></figure>

After installing the FBX Exporter package, you will see this option in the **GameObject** menu from the top bar:&#x20;

<figure><img src="/files/qrTvBmwsGQVHCT7MK0e7" alt=""><figcaption></figcaption></figure>

While having our chest prefab selected (from the project window or the scene directly), click on '**Export to FBX...**' option.

I recommend these export options:

<figure><img src="/files/hqosYDpQ02IH6LMk28LD" alt=""><figcaption></figcaption></figure>

By default it will export the new chest in the Assets root folder. You can use the exported FBX file outside Unity projects, like Godot or Unreal projects.

## 🛠️ Contact support

For questions and issues send an email to:\
\&#xNAN;***<support@keviniglesias.com>***

Visit my website for more tools, 3D models and animations:\
[**www.keviniglesias.com**](https://www.keviniglesias.com/)


---

# Agent Instructions: Querying This Documentation

If you need additional information that is not directly available in this page, you can query the documentation dynamically by asking a question.

Perform an HTTP GET request on the current page URL with the `ask` query parameter:

```
GET https://kevin-iglesias.gitbook.io/auto-rig-chest/auto-rig-chest-documentation.md?ask=<question>
```

The question should be specific, self-contained, and written in natural language.
The response will contain a direct answer to the question and relevant excerpts and sources from the documentation.

Use this mechanism when the answer is not explicitly present in the current page, you need clarification or additional context, or you want to retrieve related documentation sections.
