You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Currently, the WeaponManager has an array that can store 2 weapon resources. This array is tied to the Weapon Slots in inventory. If a weapon slot is empty, then the array stores a value of NULL. The player is prevented from switching to a null slot at current time. This is a good start to ensure no null errors, but has led to the issue of the UI not updating correctly when no weapons are equipped.
The easiest solution, besides force refresh to default values, is to implement a default weapon. I am thinking fists (melee weapon).
I'll first need to address melee weapons in general. Then, I need to fill the array with melee, without it talking to the inventory. This can be achieved by storing the resource locally in the WeaponManager, and filling the slot when a weapon is unequipped.
PLEASE NOTE that when switching slots, the logic at current is to unequip and equip. Make sure to add control flow to unequip to know whether or not the inventory slot was swapped or entirely removed.
The text was updated successfully, but these errors were encountered:
Currently, the WeaponManager has an array that can store 2 weapon resources. This array is tied to the Weapon Slots in inventory. If a weapon slot is empty, then the array stores a value of NULL. The player is prevented from switching to a null slot at current time. This is a good start to ensure no null errors, but has led to the issue of the UI not updating correctly when no weapons are equipped.
The easiest solution, besides force refresh to default values, is to implement a default weapon. I am thinking fists (melee weapon).
I'll first need to address melee weapons in general. Then, I need to fill the array with melee, without it talking to the inventory. This can be achieved by storing the resource locally in the WeaponManager, and filling the slot when a weapon is unequipped.
PLEASE NOTE that when switching slots, the logic at current is to unequip and equip. Make sure to add control flow to unequip to know whether or not the inventory slot was swapped or entirely removed.
The text was updated successfully, but these errors were encountered: