> For the complete documentation index, see [llms.txt](https://malbersanimations.gitbook.io/animal-controller/llms.txt). Markdown versions of documentation pages are available by appending `.md` to page URLs; this page is available as [Markdown](https://malbersanimations.gitbook.io/animal-controller/super-item/super-item-system/how-to/create-a-melee-weapon.md).

# Create a Melee Weapon

This walkthrough builds a sword that can be picked up, holstered, drawn with an animation, and swung for damage. Everything else in the system is a variation on it.

***

## Before you start

The character needs a Super Item Manager with at least one Equip Point and one Holster. Add the component and let `Reset` create them.

***

## 1 — Prepare the item GameObject

1. Drop the sword model in the scene and make sure the **root** is at the grip, pointing the way it should sit in the hand. It does not have to be exact — the offset fixes the rest — but a sane root saves you fighting the handles later.
2. Add the **Super Item** component to the root: `Malbers ▸ Interaction ▸ Super Item`.

`Reset` adds a `Rigidbody`, sets the layer to `30` (Items), adds the *On Focused* pick-up prompt, and fills in default Modes and IDs.

***

## 2 — Give it an identity

On the **General** tab:

| Field                | Section          | Value                                   |
| -------------------- | ---------------- | --------------------------------------- |
| Item Type            | General          | `Sword`                                 |
| Can Be Equipped With | General          | `Shield` (leave empty for a two-hander) |
| Equip Point          | Holsters & Equip | `Right Hand`                            |
| Holster              | Holsters & Equip | `Left Holster`                          |

***

## 3 — Add the damage trigger

1. Create a child GameObject along the blade named `Attack Trigger`.
2. Add a **Box Collider**, set it to **Is Trigger**, and size it to the blade.
3. Add a **Trigger Proxy** component.

The Super Item collects trigger proxies from its children automatically — the **Triggers** list on the item is read-only and always rebuilt.

***

## 4 — Give it damage

Add a **Stats** component to the sword root with one Stat:

| Field     | Value    |
| --------- | -------- |
| ID        | `Attack` |
| Min Value | `20`     |
| Max Value | `25`     |
| Value     | `25`     |

{% hint style="info" %}
You can skip this step. When you add the Damager processor in step 6 it creates the `Stats` component and seeds this exact Stat for you — then you just tune the numbers.
{% endhint %}

***

## 5 — Create the Action Set

Switch to the **Sets & Actions** tab. `Reset` already created a `Default` set with one `Attack` Action. Confirm the set is flagged both **Active** and **Def**, and that **Ign** is off.

On the `Attack` Action:

| Field      | Value                                  |
| ---------- | -------------------------------------- |
| Action ID  | `Attack`                               |
| Activation | `Pressed`                              |
| Rate       | `0.5` (the swing cooldown)             |
| Trigger    | the `Attack Trigger` proxy from step 3 |

***

## 6 — Add the processors

On the Action's **Processors** tab, add two.

**Play Mode**

| Field          | Value             |
| -------------- | ----------------- |
| Execute        | `On Action Start` |
| Mode           | `Attack1`         |
| Ability Index  | `-99` (random)    |
| Ability Status | `Play One Time`   |

**Damager / Do Damage (Attack Stat)**

| Field               | Value                              |
| ------------------- | ---------------------------------- |
| Execute             | `On Trigger Enter`                 |
| Damage ▸ Target     | `Health`                           |
| Damage ▸ Modify     | `Substract Value`                  |
| Damage ▸ Value From | `Use Sources`                      |
| Damage ▸ Sources    | one term reading the `Attack` Stat |

That is exactly what the processor fills in for you on creation — in most cases you only check it and move on. To roll damage randomly inside the Attack range instead of using its current Value, set that Source term's part to `Random [Min-Max]`.

***

## 7 — Author the offsets

1. With the sword selected, press **Equip in Char** at the top of its inspector and pick the character. (Or select the character, open the Manager's **Equip Points** tab, and assign the sword to the `Right Hand` point's **Item** field.)
2. The Scene View draws the sword at its runtime transform, with position, rotation and scale handles. Drag it into the grip.
3. That is it — the offset is written into the character's `SuperItemOffsets` asset as you drag. There is no Save button.
4. Repeat with **Holster in Char** for the `Left Holster`.

***

## 8 — Wire the input

On the Manager's **Inputs** tab, confirm the `Actions Input` list maps the `Attack` Action ID to an input name your input source provides.

On the **Holsters** tab, give the `Left Holster` an `Input` so the player can draw and store the sword.

***

## 9 — Test

Press Play. Walk into the sword, pick it up, press the holster input to draw, press attack to swing.

If something does not work, in this order:

| Symptom                                | Check                                                                                 |
| -------------------------------------- | ------------------------------------------------------------------------------------- |
| The sword drops instead of holstering  | The item's `Holster` ID has no matching holster on the Manager. The console names it. |
| The sword is inside the hand           | No offset entry for (Sword + Right Hand). Redo step 7.                                |
| No arm animation                       | The `Right Item Type` Animator parameter, or the item's `Item Type`.                  |
| Nothing happens on the attack input    | The `Attack` Action ID is missing from the Manager's `Actions Input` list.            |
| The swing animates but deals no damage | The Action's `Trigger` field is empty, or the Damager's Profile does not match.       |
| The Action Set never activates         | It is flagged **Ign**. An ignored set is skipped by every Auto Activation.            |

Use the **Validate** button on the item to catch most of these before pressing Play, and enable **Debug** on the item and Manager to trace the rest.
