Agent stops shooting after reload

arenoo

Member
I somehow messed up the shooting logic of the bots. After they shoot out their magazine and reload they stop shooting. Debugger is showing that it just keeps returning TaksStatus.Running at line 82 but the agent is not shooting. When I shoot them back and trigger the Damaged branch they start shooting again and stops after reload. What may be the cause? The behavior tree task is still being run. I have changed the tree/task code a little over time but I don't recall changing anything within shooting logic.1702647873564.png
 
The task is likely ok and it's probably an issue with the use ability. Double check that if you are relying on an animation event for use/use complete that the event is firing. You could also test out a timer instead of animation event.
 
I've set it to timer mode but I get the same result. Also in the inspector when the agent starts shooting the use ability is set to active (as expected) then when is out of ammo the reload ability is activated but the use is still active. After the reload complete event is fired the reload ability is deactivated and the use is still active but the agent doesn't shoot. Btw when I disable use ability from the inspector and enable it back the agent starts shooting again until the next reload
1702981470558.png

Edit: I found out that when I hold down the shooting button on the player I get the same result (stops shooting after automatic reload, in the inspector Use is active). So I've added the Use ability into ShouldStopActiveAbility in Reload.cs and the agents got fixed but the player didn't. Is this a good approach and if so how can I fix the player too?1702983276089.png
 
Last edited:
Ok, so it's related to the reload module. You have an animation event set there - have you ensured that it is triggering?
 
Ok, so it's related to the reload module. You have an animation event set there - have you ensured that it is triggering?
Well as I said, the reload ability is being actvated/deactivated correctly in the UltimateCharacterLocomotion inspector, so I think yes?
 
If it only occurs when the agent needs to reload then it still sounds related. Unfortunately it's really hard to debug without being able to reproduce it. Can you reproduce it within the demo scene? Or can you revert to a previous revision and see what changed in your project to better determine the cause?
 
Im sorry I can't dedicate any more time to this issue right now. I'll post in this thread in the future if something changes. For now I will just use the ability blocking method I mentioned above. Thank you
 
Top