โš”๏ธWeapon Manager

1.4.2d

Overview

This component manages all the weapons of the character

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.


General

Start Weapon

Set a weapon on this parameter to let the character start with a weapon already equipped.

Ignore Draw

Ignores the Draw | Unsheathe animations and equips the weapon instantly

Ignore Store

Ignores the Store | Sheathe animations and unequips the weapon instantly

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)

Weapon Hand 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.

Ignore Hand Offset

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


Holsters and External

You can change between Use Holsters and Use External.

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

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.

Holsters ID also works as the Animator Value to play the correct sheathe and unsheathe animations when equipping/unequipping a weapon

Holster Time

This will smoothly parent a weapon from the holster to the Hand and vice versa.

Set it to zero to instantly parent the weapon.

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.

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)

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).

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 )

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 (Left Holster) but the sword is parented to the Hip Slot, and the Spear is parented to the Back Slot.


Use External

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

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)

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.


AC Animal Controller

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

Animal

Reference to the Animal Component

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

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.

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.

Exit Fast

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


Events

OnCombat Mode (Boolean)

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

On Can 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


Inputs

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


Advanced

The Advanced section was created to add the Layer Animation on other Animator components like Invector.

If the Upper Body Weapon Layer is not found in the current animator a Green Button will be shown to add it manually.


Animator

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


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

Last updated