"Weapon Assignment Bug" | Rex Mejia | 7-17-25


The Problem

During this week's sprint, I had an issue where the Enemy Agent could not properly equip a designated rifle. The rifle was being derived from the BaseCharacter but even though it was there visually the rifle would not do commands. When trying to debug the issue, the rifle was assigned as a child actor component in the editor but when the game ran, the references would come back null therefore wouldn't respond to function calls as expected. The result ended up with the enemy standing idly or ran it's wander function call if the player left its field of view. This made testing other functions of the game come to a standstill and until it was corrected, we could not move forward.

Problem Solution

With this bug hindering progress, I made a new WeaponChildActor that would respond to function calls and attached this working Rifle to the enemy. This led to another issue of the enemy now having two weapons visually, even though only one worked with the function calls. After some help from teammates, I was able to remove the old weapon reference and assign the new rifle as the functional weapon for the enemy. After validating that the new rifle successfully executed Fire functions, the enemy was able to engage the player in combat as intended. Which allowed us to progress to the other objectives we had for this week's sprint. 

Leave a comment

Log in with itch.io to leave a comment.