# Create Magazine

This page contains the full workflow and reference for external magazine setup, magazine Blueprints/data, the guiding spline workflow, and the Instanced Round Mechanism (ISM) used to visually represent rounds inside magazines.

***

## Weapon-side: Magazine Insertion & Guiding Spline

Place the Magazine Insertion Collision

* Add a **Magazine Insertion Collision** component at the magwell entrance on the firearm. This is the collision the magazine will overlap to start guiding/seating.
* Make sure the firearm's static mesh doesn't have a collision at the magwell entrance that would block the magazine from entering.

Create / align the Magazine Guiding Movement Spline

{% stepper %}
{% step %}

### Temporarily add a helper static mesh magazine

* Add a helper **Static Mesh** magazine to the scene.
* Parent it to the **Magazine Guiding Movement Spline** and set its local position to **(0,0,0)** — this represents the fully seated pose.
  {% endstep %}

{% step %}

### Move the spline to align seating

* Move the **spline** (do not move the helper mesh) until the helper mesh appears perfectly seated in the magwell.
  {% endstep %}

{% step %}

### Define the guide length

* With the helper mesh still parented to the spline, drag the helper mesh outwards along the insertion path until it first contacts the firearm’s **Magazine Insertion Collision**.
* Record the offset from the seated pose and use that for the spline’s second point (this defines guide length).
  {% endstep %}

{% step %}

### Clean up

* Remove the helper mesh once you have the spline points set.
  {% endstep %}
  {% endstepper %}

{% hint style="info" %}

* Always move the spline to align seating; the helper mesh should remain at (0,0,0) while aligning.
* The spline’s second point (guide length) should represent the magazine’s first contact point with the magwell so the guiding movement looks natural.
  {% endhint %}

***

## Magazine asset: Creating a Reality Magazine

{% stepper %}
{% step %}

### Create the Blueprint

* Create a new **Blueprint → Reality Magazine**.
  {% endstep %}

{% step %}

### Create and assign data asset

* Create a **Reality Magazine Data Asset** and assign it in the magazine BP.
  {% endstep %}

{% step %}

### Set base mesh

* Set the magazine’s **Base Mesh**.
  {% endstep %}

{% step %}

### Add and position Magazine Insertion Collision

* Add and position a **Magazine Insertion Collision** on the magazine.
* The firearm checks overlap between its own **Magazine Insertion Collision** and the magazine’s **Magazine Insertion Collision** to begin the guiding/seating process.
* When overlap is detected, the magazine guiding logic takes over and moves the magazine along the guiding spline until it reaches the fully seated pose.
  {% endstep %}
  {% endstepper %}

Magazines are Reality Interactables

* Magazines inherit from **Reality Interactable**, so they support the standard interactable and grip behaviors. Implement grips as needed for natural pickup and manipulation.

***

## ISM Round Mechanism System (Instanced Rounds)

The **Instanced Round Mechanism (ISM)** visually represents and manages rounds inside a magazine using instancing for performance.

InstancedRoundGenerator

* Each **Reality Magazine** can contain an `InstancedRoundGenerator` component (derived from Unreal’s `InstancedStaticMesh`).
* This component:
  * Places repeated round meshes inside the magazine,
  * Reduces draw calls by using instancing,
  * Lets you control spacing/alignment parameters so rounds stack correctly and visually match the magazine interior.

Example

* See `RealityMagazine_AK47_Example` for a working magazine setup using the ISM Round Mechanism.


---

# 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/firearm/create-magazine.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.
