Problems with switching weapons

Author: Xavier Williams

Problem:
    A problem I had with development was implementing weapon switching for the player. The first problem was the player being able to pick up a weapon when they already had the maximum amount. Another issue was the gun staying on the ground if you already have the max amount of weapons, but still rotating and shooting with the player. When picking up two weapons, both of the models would show at the same time, and later, when trying to fix this,  when you have one weapon, other weapons would become invisible on the ground.
    

Solution:
    To solve being able to hold too many weapons, I put in multiple checks to see how full the array of weapons the player is holding is. To fix the problem with weapons on the ground shooting, I disabled their ability to shoot until they are picked up by a player. I fixed the problems with the weapon models by disabling weapons that are held by a player, but not equipped while ignoring weapons that are still on the ground.

Comments

Popular posts from this blog

Procedural Generation - Room NavMesh Spawning

Powerups and Wall clipping