# 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="https://384972593-files.gitbook.io/~/files/v0/b/gitbook-x-prod.appspot.com/o/spaces%2FTRJHPYhGbFFoAYrrWrIi%2Fuploads%2Fu5XkNDfusOgaKctXgPF9%2Fimage.png?alt=media&#x26;token=aa56724e-bcc2-43a9-ac12-a42dc7ba05ed" alt=""><figcaption><p>✅ Base and lid are separated objects: <strong>Compatible</strong>.</p></figcaption></figure> <figure><img src="https://384972593-files.gitbook.io/~/files/v0/b/gitbook-x-prod.appspot.com/o/spaces%2FTRJHPYhGbFFoAYrrWrIi%2Fuploads%2FtUAd8oteOYcpm9DMMfGq%2Fimage.png?alt=media&#x26;token=edaf2afb-dca1-4c4a-8d75-54249edb7747" 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="https://384972593-files.gitbook.io/~/files/v0/b/gitbook-x-prod.appspot.com/o/spaces%2FTRJHPYhGbFFoAYrrWrIi%2Fuploads%2FMszbGokG8698hAuQScyp%2Fimage.png?alt=media&#x26;token=94152527-9b64-488a-a760-4dde8e3ae8a9" 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](https://assetstore.unity.com/packages/3d/props/treasure-chest-aku-88449))

<figure><img src="https://384972593-files.gitbook.io/~/files/v0/b/gitbook-x-prod.appspot.com/o/spaces%2FTRJHPYhGbFFoAYrrWrIi%2Fuploads%2F5fYHHFAFBpwcdjgtkRlf%2Fimage.png?alt=media&#x26;token=b4ab3de4-3adf-4c25-9c8d-678dfeffd34f" 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="https://384972593-files.gitbook.io/~/files/v0/b/gitbook-x-prod.appspot.com/o/spaces%2FTRJHPYhGbFFoAYrrWrIi%2Fuploads%2FCSgx1oDELbDIivI4TIRz%2Fimage.png?alt=media&#x26;token=f9882928-7bf0-4089-ab24-a79c0f1bde1e" 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="https://384972593-files.gitbook.io/~/files/v0/b/gitbook-x-prod.appspot.com/o/spaces%2FTRJHPYhGbFFoAYrrWrIi%2Fuploads%2F2wnM1nyheYRRi3l70cYV%2Fimage.png?alt=media&#x26;token=9ae4d8c7-c93f-4bac-aea3-e8517b004d94" 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="https://384972593-files.gitbook.io/~/files/v0/b/gitbook-x-prod.appspot.com/o/spaces%2FTRJHPYhGbFFoAYrrWrIi%2Fuploads%2FEpQfQW3voZquAXB3kxKK%2Fimage.png?alt=media&#x26;token=6aa67ac0-f7c1-4529-8450-816db70c8e7a" 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="https://384972593-files.gitbook.io/~/files/v0/b/gitbook-x-prod.appspot.com/o/spaces%2FTRJHPYhGbFFoAYrrWrIi%2Fuploads%2FLs5rxOEM6yCOj19DDQWT%2Fimage.png?alt=media&#x26;token=04046044-286c-4ec8-a510-878fa4be5a06" alt=""><figcaption><p>Our treasure chest.</p></figcaption></figure> <figure><img src="https://384972593-files.gitbook.io/~/files/v0/b/gitbook-x-prod.appspot.com/o/spaces%2FTRJHPYhGbFFoAYrrWrIi%2Fuploads%2FqxGdTWLCmRQ1fFnd11i3%2Fimage.png?alt=media&#x26;token=3f6fedef-f02a-45ea-9f59-a38f887d05aa" alt=""><figcaption><p>Our treasure chest with the TreasureChestTemplateRig in the same position.</p></figcaption></figure></div>

<figure><img src="https://384972593-files.gitbook.io/~/files/v0/b/gitbook-x-prod.appspot.com/o/spaces%2FTRJHPYhGbFFoAYrrWrIi%2Fuploads%2FY8TOgapxFmQZwhepohxJ%2Fimage.png?alt=media&#x26;token=32526247-0f04-4d5d-b472-b59b3c69a1a7" 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="https://384972593-files.gitbook.io/~/files/v0/b/gitbook-x-prod.appspot.com/o/spaces%2FTRJHPYhGbFFoAYrrWrIi%2Fuploads%2FSpyTHtMdwFaaAWwRlM10%2Fimage.png?alt=media&#x26;token=e63872ca-b9bc-451e-a19a-69c04c41a748" alt=""><figcaption><p>Assigning the <strong>base</strong> mesh (sometimes called bottom) to its field in step 3.</p></figcaption></figure>

<figure><img src="https://384972593-files.gitbook.io/~/files/v0/b/gitbook-x-prod.appspot.com/o/spaces%2FTRJHPYhGbFFoAYrrWrIi%2Fuploads%2FazfFsLookoerQbjy5bek%2Fimage.png?alt=media&#x26;token=6c5e6ec8-96dd-421d-87b5-6c208630a7d6" 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="https://384972593-files.gitbook.io/~/files/v0/b/gitbook-x-prod.appspot.com/o/spaces%2FTRJHPYhGbFFoAYrrWrIi%2Fuploads%2FJx5qCWafRDJIsOwUXCDn%2Fimage.png?alt=media&#x26;token=24ac15f3-2d7d-4850-a74f-543121110dfb" alt=""><figcaption></figcaption></figure> <figure><img src="https://384972593-files.gitbook.io/~/files/v0/b/gitbook-x-prod.appspot.com/o/spaces%2FTRJHPYhGbFFoAYrrWrIi%2Fuploads%2FnrJJ0Fg1ACm1fIMbXpRy%2Fimage.png?alt=media&#x26;token=6c81105f-7616-4ce6-811b-63f71e94680d" 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="https://384972593-files.gitbook.io/~/files/v0/b/gitbook-x-prod.appspot.com/o/spaces%2FTRJHPYhGbFFoAYrrWrIi%2Fuploads%2Fdcw0kQ1CqWYpv16v7jRZ%2Fimage.png?alt=media&#x26;token=55480907-a642-429b-918e-a703976a4c58" alt=""><figcaption></figcaption></figure>

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

<figure><img src="https://384972593-files.gitbook.io/~/files/v0/b/gitbook-x-prod.appspot.com/o/spaces%2FTRJHPYhGbFFoAYrrWrIi%2Fuploads%2FmeETcaExX55XdYT2XuEU%2Fimage.png?alt=media&#x26;token=1414ae83-e871-48a1-b14f-1ee6d87bbac6" 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="https://384972593-files.gitbook.io/~/files/v0/b/gitbook-x-prod.appspot.com/o/spaces%2FTRJHPYhGbFFoAYrrWrIi%2Fuploads%2FEOBz6c8au8WwRdd6nPhs%2Fimage.png?alt=media&#x26;token=82f3fc8c-9b14-43d2-b0e5-075f35f6070d" alt=""><figcaption><p>Adjusting the lid position.</p></figcaption></figure>

<div><figure><img src="https://384972593-files.gitbook.io/~/files/v0/b/gitbook-x-prod.appspot.com/o/spaces%2FTRJHPYhGbFFoAYrrWrIi%2Fuploads%2FG4gWrmjsNZ4SnQxaY8YW%2Fimage.png?alt=media&#x26;token=7807bba3-ef01-4518-8968-92fac42e7204" alt=""><figcaption><p>Rotating the template lid to match the chest lid.</p></figcaption></figure> <figure><img src="https://384972593-files.gitbook.io/~/files/v0/b/gitbook-x-prod.appspot.com/o/spaces%2FTRJHPYhGbFFoAYrrWrIi%2Fuploads%2F1hqs90a16TPDrmawW5A9%2Fimage.png?alt=media&#x26;token=f86453f3-8db5-4a9b-8d63-37e103e2db1c" 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="https://384972593-files.gitbook.io/~/files/v0/b/gitbook-x-prod.appspot.com/o/spaces%2FTRJHPYhGbFFoAYrrWrIi%2Fuploads%2FocKLe1PiLlXrgwbpHZmK%2Fimage.png?alt=media&#x26;token=8166e3f8-55cb-4735-b11a-b588688addff" 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="https://384972593-files.gitbook.io/~/files/v0/b/gitbook-x-prod.appspot.com/o/spaces%2FTRJHPYhGbFFoAYrrWrIi%2Fuploads%2FdvlsC0WHPrZYwUwzfqJs%2Fimage.png?alt=media&#x26;token=b7098dc6-f4da-4655-a3f5-9f5e791a7702" 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="https://384972593-files.gitbook.io/~/files/v0/b/gitbook-x-prod.appspot.com/o/spaces%2FTRJHPYhGbFFoAYrrWrIi%2Fuploads%2FZsjEunjiZAoXb9duSwSa%2Fimage.png?alt=media&#x26;token=7a46f74d-6a5d-4936-a308-3fd9ee5915c0" alt="" data-size="original">      ![](https://384972593-files.gitbook.io/~/files/v0/b/gitbook-x-prod.appspot.com/o/spaces%2FTRJHPYhGbFFoAYrrWrIi%2Fuploads%2F1zwRqhmn3I4B6g9NgrFw%2Fimage.png?alt=media\&token=ff744a17-3084-4680-be33-08703292cea9)
{% endhint %}

<figure><img src="https://384972593-files.gitbook.io/~/files/v0/b/gitbook-x-prod.appspot.com/o/spaces%2FTRJHPYhGbFFoAYrrWrIi%2Fuploads%2F5rHed9VE1JLqqVF3cgIx%2Fimage.png?alt=media&#x26;token=97e912f6-57d0-4b45-85ba-73883882ab89" 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="https://384972593-files.gitbook.io/~/files/v0/b/gitbook-x-prod.appspot.com/o/spaces%2FTRJHPYhGbFFoAYrrWrIi%2Fuploads%2FMS8hFMvNrq2lrelsSXeN%2Fimage.png?alt=media&#x26;token=9e1ab80f-2001-4882-91f0-2897fd2475f3" 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="https://384972593-files.gitbook.io/~/files/v0/b/gitbook-x-prod.appspot.com/o/spaces%2FTRJHPYhGbFFoAYrrWrIi%2Fuploads%2FwZr8Lqk157BfRUz4fFPR%2Fimage.png?alt=media&#x26;token=919025ea-a58f-4208-90a7-c5e6ea0d46f0" 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="https://384972593-files.gitbook.io/~/files/v0/b/gitbook-x-prod.appspot.com/o/spaces%2FTRJHPYhGbFFoAYrrWrIi%2Fuploads%2FO9IRzyrcjfPJWTGYfk81%2Fimage.png?alt=media&#x26;token=282abbe8-a8d4-4fa8-95b3-4372ebcada4a" 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/)



