Hi everyone,
I’m facing an issue with AI in my Unreal Engine 5 game using Blueprints. I implemented a cover system where enemies seek cover when they spot the player. However, when multiple enemies are present at the same time, they all end up choosing the exact same cover point, causing them to overlap.
I tested spawning the enemies at different times, and in that case, the issue doesn’t happen—each AI picks a different cover. But since there are situations where multiple enemies need to spawn at once, this is not a viable solution.
Does anyone know how I can prevent multiple AIs from selecting the same cover? Is there an efficient way to mark a cover as “occupied” so other AIs ignore it?
Here is how the system works.
I have multiple cover points scattered throughout the world that are controlled by a manager, here is the logic:
And this manager is called within the behavior tree.
Thanks in advance for your help