CanHearObject task returns true instantly on Tree reset

Grannyboy

Active member
I have a behavior tree where I use the CanHearObject which listens to my weapon as a global variable. When I start the game this returns false, as it should. Then when the agent hears my gun shot it returns true which is corret.

But after I kill the agent and he respawns 10 sec later bout 100+ units away it instantly returns true, even tho no sound is made for the agent to hear.
1642856721047.png

Why does this instantly return true even tho there is no sound made? How can I reset the tree completly so this wont happen?
 
I decided to take a different approach to this bug and solved it by adding a "can see object" action. This is set to be 360 degrees and 15 meters in distance. This means that the zombie has to both hear and be in the 15 meter hearing/seeing radius to attack. Workes perfectly:
1643136791006.png
1643136807012.png
 
Top