[Solved]
Hey guys, I’m having a problem in my game, the method AggrevateNearbyEnemies () is called every frame, because it is called in the AttackBehavior(), when multiple enemies are in the shout range, and it resets the nearby enemies timeSinceLastAggro, causing them to never leave the IsAggrevated state. I tried to add a condition that says if the enemy is already aggrevated it would be skipped in the for loop, but that didn’t work. What I have now, is that when the enemy is aggrevated, they will never go back to the suspicion state. I don’t know if anyone else is having this problem, if so, how can we solve it?
To solve this problem, I’ve created a bool hasShout, starting the value as false, and checking before the enemy call AggrevatedEnemies() if the bool is false, inside the method, I’ve turn the bool to true, causing the enemies to stopping calling the method. After the AttackBehavior has passed, I turn the bool to false again, so the enemy can call the method if the player is seen
4 Likes
This topic was automatically closed 24 hours after the last reply. New replies are no longer allowed.