How to implement sheath weapon mechanic using a keypress

Special thanks to Zliryu from Discord for creating this tutorial.

1. Add a new bool variable (default value is false) to the character and recreate this key press event

hideweap1

2. Add a check for the new bool on the Fire event on BP_CharacterBase
fpskitSHEATHED1

3. In the W_WeaponInventory_UI widget in the drop weapon button logic, at the end if it add the following
fpskitSHEATHED3

4. On the character, on the X event to drop a weapon, add the same bool and set it to false
fpskitSHEATHED2

 

5. Add this to BP_WeaponBase

hideweap5

 

6. (Optional) Create this event on the character, you can use any key.

sheathWeaponv2

 

That’s it!