Skip to content

Weapon Stashes

Weapon Stashes is a lightweight inventory system to assign weapons to a Player Character and allow the player to switch between them. It is compatible with both Shooter and Melee module weapons. Currently, only a weapon's default ammo is supported.

Weapon Stash Component#

A Weapon Stash must be added to a game object (usually the player):

Weapon Stash component

Adding a Weapon#

There are two actions for adding weapons: Give Shooter Weapon and Give Melee Weapon. When configuring these actions, be sure to select the Target Game Object (usually the player) with a Weapon Stash.

Changing Weapons#

The current weapon can be switched to the next (or previous) weapon in the stash with the Cycle to Next Weapon action.

Weapon Stash UI Component#

The Weapon Stash UI component allows a stash's current weapon and ammo (if any) to be displayed on screen. This component differs the Shooter module's AmmoUI component in that it contains weapon information, not just ammo. Also, it will display the name of Melee module weapons (not just Shooter weapons).

The Combat Examples module includes a WeaponStashUI prefab that demonstrates how to use the component:

Weapon Stash UI component