# Prepare Meshes

This guide explains how to correctly prepare meshes for use with the **Reality Interactable** and **Reality Firearm** systems.

It covers proper **scaling**, **orientation**, **pivot point setup**, and **collision** — all of which are essential for correct behavior in VR.

***

## Accessing Reference Assets

To help verify scale and proportions, a **hand reference** is available in the Modkit:

* Open the **Content Browser**.
* Enable **Show Engine Content** (top right settings).
* Navigate to:

```
Engine → Plugins → RealityContent → Library → Interactable
```

In this folder, you’ll find various reference and example assets.

* In the Firearm Folder, an example for every gun type currently in the game.
* In the GripPose Folder, default grip poses you could use as a reference to make your own grips.
* In Melee, a Machete example.
* In Props, a DoorHandle Example (Useful as a reference point for interactables built into the map!)

These examples demonstrate proper setup and can be used as reference when adjusting your own interactables.

***

## Scaling Your Weapon

When preparing your weapon mesh, first ensure it matches the correct **VR scale** using the hand reference.

### Steps

{% stepper %}
{% step %}

### Parent components

Parent all components (i.e. magazine, trigger, charging handle) to the base mesh (main part of the weapon).

This ensures that when you scale, all parts maintain their relative positions.
{% endstep %}

{% step %}

### Scale the parent

Select the **parent mesh** and adjust the scale in the details panel.
{% endstep %}

{% step %}

### Unparent children

Unparent all child meshes so each one has the new scale applied.
{% endstep %}

{% step %}

### Modeling Tools

Select all meshes and open the **Modeling Tools** panel.
{% endstep %}
{% endstepper %}

### Baking the Transform

{% stepper %}
{% step %}
Go to **XForm → Bake Transform**.
{% endstep %}

{% step %}
Check **Apply to All LODs** and **Bake Rotation**.
{% endstep %}

{% step %}
Click **Accept**.

This sets the new scale and rotation as default (`Scale = 1.0, Rotation = 0°`).
{% endstep %}
{% endstepper %}

***

## Orientation Setup

For the Reality Firearm system to function properly, weapons must face the **+X-axis**.

### Example

If your model currently faces the **Y-axis**, follow these steps:

{% stepper %}
{% step %}
Parent all components (i.e. magazine, trigger, charging handle) to the base mesh (main part of the weapon).
{% endstep %}

{% step %}
Rotate your weapon **90°** so it aligns with the X-axis.
{% endstep %}

{% step %}
Adjust small pitch angles if needed so the barrel is level with the floor.
{% endstep %}

{% step %}
Once aligned, **unparent** the components.
{% endstep %}

{% step %}
Select them all again and **Bake Transform** (rotation and scale).

Now the default rotation should be correct for all parts (0, 0, 0).
{% endstep %}
{% endstepper %}

***

## Setting Pivot Points

Each mesh acts as a **physics object**, so correct pivot placement is important.

### Centered Pivots

For most meshes (weapon body, magazine, charging handle):

{% stepper %}
{% step %}
Open the **Modeling Tools** and go to the **XForm** tab.
{% endstep %}

{% step %}
Select **Edit Pivot** → **Center**.
{% endstep %}

{% step %}
Click **Accept** to bake the pivot.
{% endstep %}
{% endstepper %}

### Rotating Parts (Exceptions)

Some components, such as **triggers** or **levers**, need their pivots placed at their rotation point.

{% stepper %}
{% step %}
Use **Edit Pivot** and move the pivot to where the rotation should occur (usually near the hinge).
{% endstep %}

{% step %}
Fine-tune manually in the viewport.
{% endstep %}

{% step %}
Click **Accept** to bake the new pivot.
{% endstep %}

{% step %}
Test the rotation to ensure it behaves naturally.
{% endstep %}
{% endstepper %}

***

## Adding Simple Collision

Unreal Engine 5 requires meshes with **simple collision** for physics interactions.

Complex collisions are **not supported** by Reality systems.

### Checking Collision

{% stepper %}
{% step %}
Double-click the mesh to open the **Static Mesh Editor**.
{% endstep %}

{% step %}
Go to **Show → Simple Collision**.

* If nothing appears, the mesh doesn’t have simple collision.
  {% endstep %}
  {% endstepper %}

### Generating Collision

{% stepper %}
{% step %}
Open **Window → Convex Decomposition**.
{% endstep %}

{% step %}
Adjust the parameters:

* Higher values = more detailed (but slower to compute).
  {% endstep %}

{% step %}
Click **Generate** to create a collision mesh.

You can move, resize, or delete generated collision pieces to refine accuracy.
{% endstep %}
{% endstepper %}

{% hint style="warning" %}
For firearms, keep the magazine socket area clear so the magazine can be inserted properly.
{% endhint %}

### Creating Custom Collision Shapes

You can manually add:

* **Box**
* **Capsule**
* **Sphere**

Then position and scale them to match the mesh.

***

<details>

<summary>Important Notes on Collision</summary>

* Do **not** enable **“Use Complex Collision as Simple.”**
* Keep **Collision Complexity** set to **Project Default.**
* If you need highly accurate collisions, create them in a 3D modeling tool and reimport.

</details>


---

# 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://beyond-sandbox.gitbook.io/realitysdk/documentation/interactable/prepare-meshes.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.
