> 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/main-components/weapon-manager.md).

# Weapon Manager

Last updated AC v1.5.3

## Overview

This component manages all the weapons of the character

<figure><img src="https://963537199-files.gitbook.io/~/files/v0/b/gitbook-x-prod.appspot.com/o/spaces%2F-Lzhr1XSMzMqNXjRnNlb%2Fuploads%2FepPvM5C1f7Hsg2s6b1RH%2Fimage.png?alt=media&#x26;token=8458fa6a-f8b1-4de3-bd1d-3c52280217b1" alt=""><figcaption></figcaption></figure>

It controls features like store/draw - equip/unequip weapons that you want to use while riding or grounded and allows attacking with them. In order for the weapons to get recognized by the Weapon Manager component, they need to have any of the MWeapons components provided.

* **MMelee** for Melee weapons
* **MShootable** for projectile weapons
* **MBow** for Bow

These weapons will provide core data to activate Modes in the Animal Controller.

{% hint style="info" %}
**The Weapon Manager is still fully supported**, but new projects should look at the [Super Item System](/animal-controller/super-item/super-item-system.md) first: it replaces one active weapon with any number of simultaneously equipped items, data-driven Item Actions, and per-character offset assets. There is a step-by-step [migration guide](/animal-controller/super-item/super-item-system/migrating-from-the-weapon-manager.md).
{% endhint %}

***

## General

#### Start Weapon

Set a weapon on this parameter to let the character start with a weapon already equipped. The label shows **\[Prefab]** when the assigned object is a prefab — it is instantiated on start.

<figure><img src="https://963537199-files.gitbook.io/~/files/v0/b/gitbook-x-prod.appspot.com/o/spaces%2F-Lzhr1XSMzMqNXjRnNlb%2Fuploads%2Fw5uY0Z8G3wGT6O10z397%2FUnity_omPQWgff1Y.gif?alt=media&#x26;token=edc225e3-0700-4f26-a9a8-31fa81a6aa35" alt=""><figcaption></figcaption></figure>

#### Ignore Draw

Ignores the Draw | Unsheathe animations and equips the weapon instantly

#### Ignore Store

Ignores the Store | Sheathe animations and unequips the weapon instantly

<figure><img src="https://963537199-files.gitbook.io/~/files/v0/b/gitbook-x-prod.appspot.com/o/spaces%2F-Lzhr1XSMzMqNXjRnNlb%2Fuploads%2FwmSwgLLw8o36VSTtngSw%2FUnity_VBfnDTa6J1.gif?alt=media&#x26;token=67b8ec0d-4083-4d2b-9aa7-38a8c900f1b9" alt=""><figcaption></figcaption></figure>

#### Store After

The weapon will be automatically stored after a given time if that weapon has not been used. Use this if you are using the Instant weapon Equip/Attack method (Assasin Creed's Style). Zero disables it.

#### Override Weapon Layer

When a weapon is equipped, its damager triggers are re-layered to this LayerMask, so the **character** — not the weapon prefab — decides what the weapon can hit. Leave it at `Nothing` to keep each weapon's own layer.

{% hint style="warning" %}
On AI characters this is what makes their weapons able to hit the player. Set it to include **Default + Item + Animal**, the same mask the AI's Attack Triggers use.
{% endhint %}

#### Can Aim

Enables or disables the whole Aim feature for every weapon this character equips. Turning it off while aiming exits the aim first; turning it back on restores the previous aim state.

#### Weapon Equip Points (Left and Right)

Transform References for the Right and Left Hands of the Character. The weapons will be parented to any of these Transforms when are equipped. Right-handed weapons will be parented to the right hand, and left-handed weapons to the left hand.

Both have a context menu (**Find Left Hand** / **Find Right Hand**) that resolves the humanoid hand bone from the Animator.

#### Ignore Hand Offset

When parenting the Weapon to any of the Equip points, the Weapon offsets value will be ignored.

#### Pre Attack Conditions

A `Conditions2` list checked before the character is allowed to attack with the current weapon. The **dynamic target is the Weapon**, so the conditions inside resolve against it. Leave it empty to skip the check.

***

## Holsters and External

You can change between Use Holsters and Use External.

<figure><img src="https://963537199-files.gitbook.io/~/files/v0/b/gitbook-x-prod.appspot.com/o/spaces%2F-Lzhr1XSMzMqNXjRnNlb%2Fuploads%2FZRq2HwtiEip6JOW8tinx%2FUnity_tPvLwY3Yw3.gif?alt=media&#x26;token=5edfc32e-d035-4cd4-a94c-d4c8f32e9983" alt=""><figcaption></figcaption></figure>

**Use Holsters** will get the weapons received and parented to an internal holster inside the character

**Use External** will equip directly the given weapon in the character's hands.

***

### Use Holsters

<figure><img src="https://963537199-files.gitbook.io/~/files/v0/b/gitbook-x-prod.appspot.com/o/spaces%2F-Lzhr1XSMzMqNXjRnNlb%2Fuploads%2FeIeDNhAIvlEKBT6RuOyt%2Fimage.png?alt=media&#x26;token=70e98dc5-293b-4ea0-8ccf-f6e59e8bed25" alt=""><figcaption></figcaption></figure>

When you set the Weapon Manager to **use Holsters,** the weapons will use the Holster ID parameter to check where the weapons are going to be stored in the Character.

E.g. If a Sword has and Holders ID equal to \[Left Holster], when that sword is picked up, it will be stored in that holster Slot Transforms.

{% hint style="info" %}
**Holsters ID** also works as the Animator Value to play the correct sheathe and unsheathe animations when equipping/unequipping a weapon
{% endhint %}

#### Store Self Holster

When on, the currently active weapon is stored back into **its own** holster. Turn it off for the Assassin's Creed style, where pressing another holster's input swaps the weapon directly without sheathing the old one first.

#### Drop Point

Transform a weapon is moved to before it is dropped from a holster. Leave it empty to drop the weapon where it currently is.

#### Destroy On Drop

A previous weapon is destroyed when a new weapon is going to use the same holster. Enable it when using the Malbers Inventory, which keeps its own copy of the item.

#### Holster ID List

Add all the holsters your character is going to use.

#### Holster ID

ID value used to Identify the holster in the Weapon and in the Weapon Manager, to parent the weapon to the correct holster.

By default, there are 5 Holsters Created. You can create more by just duplicating any of the holsters created. Just make sure the ID value does not repeat.

<figure><img src="https://963537199-files.gitbook.io/~/files/v0/b/gitbook-x-prod.appspot.com/o/spaces%2F-Lzhr1XSMzMqNXjRnNlb%2Fuploads%2FEDlHmuyL97FlkjJ76LEZ%2Fimage.png?alt=media&#x26;token=eedc3098-ad10-4c8a-9bb1-05936e4ee090" alt=""><figcaption></figcaption></figure>

The value is also used on the Weapon Manager Animator Transitions. the ID Value and the Draw/Store Weapon Actions are combined to identify which animation will be played.

E.g. Storing a weapon with a Right Hand, to the Left Holster, uses the Transition conditions: Mode = 98001; LeftHand = false.

StoreID \[98]\*1000 + Left HosterID\[1] = 98001 . (Its the same formula used to Play Modes)

<figure><img src="https://963537199-files.gitbook.io/~/files/v0/b/gitbook-x-prod.appspot.com/o/spaces%2F-Lzhr1XSMzMqNXjRnNlb%2Fuploads%2FpO98DMuN9cgmDei5OOWp%2Fimage.png?alt=media&#x26;token=3e803212-4521-4a38-a665-2c68da4460ed" alt=""><figcaption><p>[Store] Action Value is 98. [Draw] Action value is 99.</p></figcaption></figure>

#### Weapon

You can add a weapon to a holster, so the character starts with a weapon on the holster in Play Mode. **Just make sure the weapon set on the holster has matching IDs.** (Sword with Left Hoster ID must be equipped on the Left Holster).

<figure><img src="https://963537199-files.gitbook.io/~/files/v0/b/gitbook-x-prod.appspot.com/o/spaces%2F-Lzhr1XSMzMqNXjRnNlb%2Fuploads%2FTp2Y8sVV1OBjcLNHdEF7%2FUnity_nLJUPwvRqW.gif?alt=media&#x26;token=5e0f4dba-9214-43ab-a8bb-e592f6d55c7b" alt=""><figcaption></figcaption></figure>

#### Input

Input Value set to automatically connect the Input to Unsheathing/Sheathing a weapon from a holster. (In the Demo Scenes you can draw/store weapons using \[4] key for the left holster )

<figure><img src="https://963537199-files.gitbook.io/~/files/v0/b/gitbook-x-prod.appspot.com/o/spaces%2F-Lzhr1XSMzMqNXjRnNlb%2Fuploads%2FiTzoqESF1VLPlnQ1vZdH%2FUnity_tLutSWiQKo.gif?alt=media&#x26;token=5a4613ee-90f0-4ddb-819b-31cad002384c" alt=""><figcaption><p>Pressing 4 will equip the weapon stored in the Left Holster</p></figcaption></figure>

#### Auto Equip

When a weapon is added to this holster, equip it into the hand right away instead of leaving it stored.

#### Slot List

These are Transform references to parent the weapon on a Holster. A holster can have more than one slot. Meaning that weapons using the same holster can be parented to different slots.

E.g. The Sword and the Spear share the same Holster <mark style="color:orange;">**(Left Holster)**</mark> but the sword is parented to the **Hip Slot**, and the Spear is parented to the **Back Slot.**

<figure><img src="https://963537199-files.gitbook.io/~/files/v0/b/gitbook-x-prod.appspot.com/o/spaces%2F-Lzhr1XSMzMqNXjRnNlb%2Fuploads%2F7XDdLNCWxpS2nsoXRT8V%2FUnity_9XzxTwJS07.gif?alt=media&#x26;token=2ec97e5b-4a1a-4890-bf16-bc756dd53326" alt=""><figcaption></figcaption></figure>

{% hint style="warning" %}
**Holster Time was removed.** The weapon is parented to the hand — or back to the slot — directly; there is no smooth interpolation field any more.
{% endhint %}

***

### Use External

This option will equip directly the given weapon in the character's hands.

<figure><img src="https://963537199-files.gitbook.io/~/files/v0/b/gitbook-x-prod.appspot.com/o/spaces%2F-Lzhr1XSMzMqNXjRnNlb%2Fuploads%2FDuz8QFmCI3jNOMgXS4Wh%2Fimage.png?alt=media&#x26;token=65b7390b-1297-45d0-9a47-9a9b21c5baa7" alt=""><figcaption></figcaption></figure>

Use this option if you don't want the weapons to be resting in the character, they will be instantiated directly on the hands.

This is also used for external integrations that already have their own weapon system (Invector)

<figure><img src="https://963537199-files.gitbook.io/~/files/v0/b/gitbook-x-prod.appspot.com/o/spaces%2F-Lzhr1XSMzMqNXjRnNlb%2Fuploads%2FwDl7mpx2hB43D4EqUopG%2FUnity_OOnlFYyw9O.gif?alt=media&#x26;token=a7659dea-7dd6-4841-bfe9-0706680ad699" alt=""><figcaption></figcaption></figure>

#### Instantiate On Equip

When the weapon is added to the weapon manager using Equip\_External(GameObject) it wil instantiate the weapon if its a prefab

#### Destroy On Unequip

When the current active weapon is unequipped the weapon will be destroyed. When using an external system that already destroys or hide the weapon, Disable this option.

#### Ignore Parent Weapon

The Manager does not re-parent the weapon when it is equipped. Use it with controllers that parent the weapon themselves (Invector).

***

## AC Animal Controller

All the related animal controller parameters are configured in this tab.

<figure><img src="https://963537199-files.gitbook.io/~/files/v0/b/gitbook-x-prod.appspot.com/o/spaces%2F-Lzhr1XSMzMqNXjRnNlb%2Fuploads%2FzDN8P5dp3eIa8AbSH79x%2Fimage.png?alt=media&#x26;token=c1360f06-3117-4457-89da-6f243940ae3d" alt=""><figcaption></figcaption></figure>

#### Animal

Reference to the Animal Component. Every field below is only drawn when this is assigned.

#### Mode \[Draw Weapon]

Which Mode is set to Draw/Unsheathe weapons

#### Mode \[Store Weapon]

Which Mode is set to Store/Sheathe weapons

#### Mode \[Unharmed]

Which Mode is set to unharmed attacks (Default attacks)

#### Combo Manager

Reference for the Combo Manager Component

#### Main Attack Branch / Second Attack Branch

Branch index set on the Combo Manager when the Main Attack or the Second Attack input is pressed. Defaults: `0` and `1`. This is what makes one combo asset serve a light and a heavy attack chain.

#### Disable Modes

When a weapon is equipped, Modes on this list are going to be disabled

#### Exit on States

When a weapon is equipped and a state of this list gets activated, the weapons will be temporarily stored, and when the state exits, the weapons will be equipped again.

<figure><img src="https://963537199-files.gitbook.io/~/files/v0/b/gitbook-x-prod.appspot.com/o/spaces%2F-Lzhr1XSMzMqNXjRnNlb%2Fuploads%2Fg6uhiopPpGQlXx6VPgpa%2FUnity_2ubrDUIG98.gif?alt=media&#x26;token=ab3ddc30-b27d-418c-968d-7b5f9d6b4766" alt=""><figcaption><p>Adding Climb to the list will store the weapon while climbing</p></figcaption></figure>

#### Drop Weapon

When a weapon is equipped and a State on this list gets activated, the weapon is **dropped** instead of stored. Use it for states where holding the weapon makes no sense at all — falling into water, being knocked down.

#### Exit on Modes

When a weapon is equipped and a Mode of this list gets activated, the weapons will be temporarily stored, and when the mode exits, the weapons will be equipped again.

<figure><img src="https://963537199-files.gitbook.io/~/files/v0/b/gitbook-x-prod.appspot.com/o/spaces%2F-Lzhr1XSMzMqNXjRnNlb%2Fuploads%2F7c1NPBJzvniXVtGAPVpU%2FUnity_VzOGSIVkrn.gif?alt=media&#x26;token=b90849a7-8efe-477c-afe3-f5c55c14c664" alt=""><figcaption><p>The weapon will be holstered when a Mode is playing (E.g. Action Mode -> Vault and Slide)</p></figcaption></figure>

#### Exit Fast

When enabled the weapons will be unequipped fast on the States, and they will not show the Draw/Store Animations

<figure><img src="https://963537199-files.gitbook.io/~/files/v0/b/gitbook-x-prod.appspot.com/o/spaces%2F-Lzhr1XSMzMqNXjRnNlb%2Fuploads%2FbPoB12EuclDx5tUtXWhP%2FUnity_C37wpJOJwW.gif?alt=media&#x26;token=1f3110e6-b60d-44dd-afb6-6b0ccd28f5eb" alt=""><figcaption></figcaption></figure>

{% hint style="info" %}
**Disable Modes, Exit on Modes, Exit on States and Drop Weapon are `IDList`s now**, not plain `List<ModeID>` / `List<StateID>`. They are drawn as pill/chip tags instead of an array of object fields, so a long list stays readable. Data authored with the old plain lists was migrated automatically during 1.5.x and needs no action.
{% endhint %}

***

## Events

<figure><img src="https://963537199-files.gitbook.io/~/files/v0/b/gitbook-x-prod.appspot.com/o/spaces%2F-Lzhr1XSMzMqNXjRnNlb%2Fuploads%2FMdOwfhmRwJwPtFDhZ7pg%2Fimage.png?alt=media&#x26;token=16507bb6-1c80-4c8c-b813-595868aa8620" alt=""><figcaption></figcaption></figure>

#### OnCombat Mode (Boolean)

Invoked true when a weapon is equipped, and false when a weapon is stored

#### On Aim (Boolean)

Invoked when the weapon is aiming. Sends true or false if it's aiming

#### On Equip Weapon (GameObject)

Invoked when a weapon is equipped. Sends the equipped weapon

#### On Unequip Weapon (GameObject)

Invoked when a weapon is unequipped. Sends the unequipped weapon

#### On Weapon Action (int)

Invoked when the weapon changes its current action. See List of actions in the Animator Tab

#### On Attack Start (GameObject)

Invoked when an attack begins. Sends the attacking weapon.

#### On Attack Released (GameObject)

Invoked when the attack input is released — this is the event a charged weapon fires on. Sends the attacking weapon.

#### On Weapon In Holster \[i]

One event per holster, listed under the events above when **Use Holsters** is on. Invoked when the weapon stored in that holster changes: it sends the stored `MWeapon`, or `null` when the holster is emptied — which is what a holster UI icon needs.

***

## Inputs

<figure><img src="https://963537199-files.gitbook.io/~/files/v0/b/gitbook-x-prod.appspot.com/o/spaces%2F-Lzhr1XSMzMqNXjRnNlb%2Fuploads%2FD1IgCTgInV8m4Y6oJSK0%2Fimage.png?alt=media&#x26;token=7c8e84cc-2d51-4574-bafb-acbd79172765" alt=""><figcaption></figcaption></figure>

#### Aim Input

Input name to execute the Aim Logic

#### Reload Input

Input name to execute the Reload Logic

#### Main Attack

Input name to execute the Main Attack Logic

#### Second Attack

Input name to execute the Secondary Attack

### Holster Inputs

If the Holster Option is enabled. All the Holster Inputs will be also shown in this Tab

<figure><img src="https://963537199-files.gitbook.io/~/files/v0/b/gitbook-x-prod.appspot.com/o/spaces%2F-Lzhr1XSMzMqNXjRnNlb%2Fuploads%2Fsu8oLRqmcQYqvz3387Vv%2FUnity_TnzSbOfyLy.gif?alt=media&#x26;token=fd36f1b6-2a92-4a00-8d1a-94fa65ebc78e" alt=""><figcaption></figcaption></figure>

***

## Advanced

The Advanced tab holds the two settings that adapt the weapons to **this** character's rig.

\[Insert Image - Advanced tab showing the Aim IK group with the IK Profiles asset drawn inline, and the Character Scale field]

#### Aim IK — IK Profiles

A **Weapon IK Profiles** asset: a list of `Weapon ID → Aim IK Profile (Left / Right)` overrides. Assign one and it **overrides the Aim IK Profile stored on every weapon** this character equips.

Weapons ship with IK Profiles authored for one specific skeleton. A character whose bones are oriented or nested differently — Synty, Mixamo, a custom rig — gets twisted by them. Create one asset per rig (`Assets ▸ Create ▸ Malbers Animations ▸ Weapons ▸ Weapon IK Profiles`), name it after the rig, and share it between every character using that skeleton.

The weapon prefabs are never modified, so a weapon can be shared by characters with completely different rigs at the same time. A Weapon ID with no entry simply falls back to the profile stored on the weapon.

The asset is drawn inline here, so the profile list is editable without leaving the character.

#### Character Scale

Scales the IK values of the weapons, for characters that are noticeably bigger or smaller than the rig the profiles were authored on.

{% hint style="warning" %}
**The old `Add Combat Layers` button and the per-weapon `Custom IK Weapons Left/Right` lists were removed.** Copy an Animator layer with the **Animator Layer Copier** tool instead, and use the IK Profiles asset above for the rig overrides.
{% endhint %}

***

## Animator

<figure><img src="https://963537199-files.gitbook.io/~/files/v0/b/gitbook-x-prod.appspot.com/o/spaces%2F-Lzhr1XSMzMqNXjRnNlb%2Fuploads%2FSd2zrnVcqmYnvL18spvo%2Fimage.png?alt=media&#x26;token=cbf5845c-219a-4328-9be9-2eb143604a7b" alt=""><figcaption></figcaption></figure>

#### Anim

Reference for the Animator Controller

#### Weapon Type

Name of the Weapon-Type animator Parameter

#### Left Hand

Name of the Left-Hand animator Parameter

#### IK Free Hand

Name of the IK-Free-Hand animator Parameter

#### IK Aim

Name of the IK Aim animator Parameter

Each parameter name is validated against the assigned Animator and flagged when it is missing.

{% hint style="info" %}
`ModeOn`, `Mode` and `ModePower` are only shown when there is **no** Animal assigned. With an Animal Controller on the character those parameters are owned by it.
{% endhint %}

#### Weapon Ability values

The ability index the Manager sends to the Mode for each weapon action:

| Action          | Value |
| --------------- | ----- |
| None            | 0     |
| Idle            | 100   |
| Aim             | 97    |
| Reload          | 96    |
| Draw            | 99    |
| Store           | 98    |
| Fire Projectile | 101   |

***

## Aim IK and the IK pass

The Aim IK Profile writes its bone offsets inside `OnAnimatorIK`, in the same pass as the two-handed free-hand IK goal. The `IK Aim` weight is then applied in `LateUpdate`, in Transform space, so the pose lands exactly back on the animation as the weight goes to zero.

{% hint style="warning" %}
Do not move these bone writes out of the IK pass. Every shipped IK Profile was authored against `Animator.SetBoneLocalRotation`; running them from `LateUpdate` made the pistol aim drift and split the aim offsets from the free-hand goal by one frame, which made two-handed weapons (the Bow) jitter.
{% endhint %}

***

## Debug

At runtime. Important logic will be printed in the console. Also in the inspector, all the internal variables will be exposed to show all the changes at runtime

<figure><img src="https://963537199-files.gitbook.io/~/files/v0/b/gitbook-x-prod.appspot.com/o/spaces%2F-Lzhr1XSMzMqNXjRnNlb%2Fuploads%2FHNpblfGxYOAf2uDUlXmd%2Fimage.png?alt=media&#x26;token=32a2e63f-aafa-4874-96d7-31ace4099e28" alt=""><figcaption></figcaption></figure>
