⚔️Weapon Manager
1.4.4
Last updated
1.4.4
Last updated
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.
Set a weapon on this parameter to let the character start with a weapon already equipped.
Ignores the Draw | Unsheathe animations and equips the weapon instantly
Ignores the Store | Sheathe animations and unequips the weapon instantly
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)
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.
When parenting the Weapon to any of the Equip points, the Weapon offsets value will be ignored.
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.
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
This will smoothly parent a weapon from the holster to the Hand and vice versa.
Set it to zero to instantly parent the weapon.
Add all the holsters your character is going to use.
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)
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 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 )
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.
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)
When the weapon is added to the weapon manager using Equip_External(GameObject) it wil instantiate the weapon if its a prefab
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.
All the related animal controller parameters are configured in this tab.
Reference to the Animal Component
Which Mode is set to Draw/Unsheathe weapons
Which Mode is set to Store/Sheathe weapons
Which Mode is set to unharmed attacks (Default attacks)
Reference for the Combo Manager Component
When a weapon is equipped, Modes on this list are going to be disabled
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.
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.
When enabled the weapons will be unequipped fast on the States, and they will not show the Draw/Store Animations
Invoked true when a weapon is equipped, and false when a weapon is stored
Invoked when the weapon is aiming. Sends true or false if it's aiming
Invoked when a weapon is equipped. Sends the equipped weapon
Invoked when a weapon is unequipped. Sends the unequipped weapon
Invoked when the weapon changes its current action. See List of actions in the Animator Tab
Input name to execute the Aim Logic
Input name to execute the Reload Logic
Input name to execute the Main Attack Logic
Input name to execute the Secondary Attack
If the Holster Option is enabled. All the Holster Inputs will be also shown in this Tab
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.
Reference for the Animator Controller
Name of the Weapon-Type animator Parameter
Name of the Left-Hand animator Parameter
Name of the IK-Free-Hand animator Parameter
Name of the IK Aim animator Parameter
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