# Prop Setup

The example prop used in this article is `prop_container_05a.yft`

<div align="center"><figure><img src="https://4252508569-files.gitbook.io/~/files/v0/b/gitbook-x-prod.appspot.com/o/spaces%2FcRAM9lBHCqq3QodZ420I%2Fuploads%2FOgtPm5Pr2DPLF2m8Ax3T%2Fcontainer.png?alt=media&#x26;token=5d85d28a-69c9-4886-81e9-8a38068a9ee3" alt=""><figcaption><p>prop_container_05a.yft</p></figcaption></figure></div>

### Fragment Hierarchy

<div align="left"><figure><img src="https://4252508569-files.gitbook.io/~/files/v0/b/gitbook-x-prod.appspot.com/o/spaces%2FcRAM9lBHCqq3QodZ420I%2Fuploads%2FSqkzav7iY0mqQrCeqb9e%2Fimage.png?alt=media&#x26;token=fd322ae4-a833-4520-aa3f-da18f7fccd19" alt=""><figcaption><p>prop_container_05a Blender hierarchy</p></figcaption></figure></div>

### Prop Rigging

You'll also notice that each Drawable Model is rigged using a Child Of constraint instead of vertex groups.

<div align="left"><figure><img src="https://4252508569-files.gitbook.io/~/files/v0/b/gitbook-x-prod.appspot.com/o/spaces%2FcRAM9lBHCqq3QodZ420I%2Fuploads%2FGar1uVgTL0WpWf4c7aaT%2Fimage.png?alt=media&#x26;token=faeadfab-159e-4beb-b4ac-efc4ab2d9c74" alt=""><figcaption><p>prop_container_05a.mesh</p></figcaption></figure></div>

This is the case for all props. Typically each Drawable Model for a prop corresponds to a particular separable part of the Fragment. Notice there is a Drawable Model for the latch, each door, and the container itself.

### Skeleton Setup

This matches up with the bone hierarchy.

<div align="left"><figure><img src="https://4252508569-files.gitbook.io/~/files/v0/b/gitbook-x-prod.appspot.com/o/spaces%2FcRAM9lBHCqq3QodZ420I%2Fuploads%2FbrTifkcTYizLNe8pyBph%2Fimage.png?alt=media&#x26;token=3bce7fd8-daa2-498c-a310-6ba9087941cd" alt=""><figcaption><p>prop_container_05a.skel</p></figcaption></figure></div>

Each bone is parented to `Prop_Container_05a` and is thus affected by that bone. Every skeleton in the game engine always has one root bone that all the other bones are parented to.

{% hint style="warning" %}
If you attempt to add multiple top-level bones (bones with no parent) you will run into issues. Make sure there is a single "root" bone that all other bones are parented to!
{% endhint %}

Notice, too, that each bone has `Use Physics` enabled. This means that each of those parts will have physics in-game and will separate from each other.&#x20;

<div align="left"><figure><img src="https://4252508569-files.gitbook.io/~/files/v0/b/gitbook-x-prod.appspot.com/o/spaces%2FcRAM9lBHCqq3QodZ420I%2Fuploads%2FSyNbE3pNJcIXGnszHnOZ%2FFiveM_b2944_GTAProcess_MSwcZ3DRUE.gif?alt=media&#x26;token=a4d315d5-761a-4d20-8e5d-64aa2277e50f" alt=""><figcaption></figcaption></figure></div>

{% hint style="info" %}
In this case, the doors don't actually "separate" from the mesh, but fling open instead. This is because the `Strength` bone physics property is set to -1. When set to another value (i.e. 100) you'll notice that the parts will separate.
{% endhint %}

<div align="left"><figure><img src="https://4252508569-files.gitbook.io/~/files/v0/b/gitbook-x-prod.appspot.com/o/spaces%2FcRAM9lBHCqq3QodZ420I%2Fuploads%2FfnRQ7MYxlxW54Z6WPFD6%2FFiveM_b2944_GTAProcess_tiAgH2YNzr.gif?alt=media&#x26;token=ecd763b9-a691-42f5-94ef-72e2466c60bd" alt=""><figcaption><p>With Strength set to 100 for both doors</p></figcaption></figure></div>

### Collisions

As mentioned before, each bone with physics enabled must have an associated collision. However, there can be multiple collisions for a single bone. Notice for this prop, there is a single collision for the latch and the doors, but the container itself is comprised of 5 box collisions.

<div align="left"><figure><img src="https://4252508569-files.gitbook.io/~/files/v0/b/gitbook-x-prod.appspot.com/o/spaces%2FcRAM9lBHCqq3QodZ420I%2Fuploads%2FC28bmm0Ma1dE37UZ4yk5%2Fimage.png?alt=media&#x26;token=07dac76d-a7fb-49f9-895e-454f8391cb92" alt=""><figcaption><p>prop_container_05a.col</p></figcaption></figure></div>

{% hint style="info" %}
You will notice that a lot of vanilla collisions will use bound shapes wherever possible. This is typically preferred over using a bound mesh as it is much more performant. **Keep collisions as simple as possible.**
{% endhint %}

Each of these collision objects is linked to a bone via a Child Of Constraint.

<div align="left"><figure><img src="https://4252508569-files.gitbook.io/~/files/v0/b/gitbook-x-prod.appspot.com/o/spaces%2FcRAM9lBHCqq3QodZ420I%2Fuploads%2FHFImcBUUHTLPYg9mkJgH%2Fimage.png?alt=media&#x26;token=f3eb85b0-5c2a-4868-b8c6-3b0edc6c8653" alt=""><figcaption><p>Prop_CDoor_L.col constraints panel</p></figcaption></figure></div>

Each collision also has its mass set in the `Object Properties > Sollumz > Physics` panel.

<div align="left"><figure><img src="https://4252508569-files.gitbook.io/~/files/v0/b/gitbook-x-prod.appspot.com/o/spaces%2FcRAM9lBHCqq3QodZ420I%2Fuploads%2F0iPwYyjjOAdpaaQATb64%2Fimage.png?alt=media&#x26;token=3c2b2770-10f8-49fc-abf1-0774e254598f" alt=""><figcaption><p>Object Properties > Sollumz > Physics</p></figcaption></figure></div>

### Quick Note on YTYP Flags

{% hint style="info" %}
In order for physics to work for your prop in-game, make sure the YTYP archetype has the "Dynamic" flag enabled!
{% endhint %}

<div align="left"><figure><img src="https://4252508569-files.gitbook.io/~/files/v0/b/gitbook-x-prod.appspot.com/o/spaces%2FcRAM9lBHCqq3QodZ420I%2Fuploads%2FBDDnRoSVIACWDRxH4Jna%2Fimage.png?alt=media&#x26;token=4cbb4144-329a-4ef0-995c-63498940e94b" alt=""><figcaption><p>Archetype Definition > Archetypes > crate > Flags</p></figcaption></figure></div>
