So here is what I want to do. I have my enemies who are melee fighters. These, when they see the player should run to him and try to surround him. Obviously there is a finite amount of free spaces around the player, so the ones that can’t fit, should stay behind. This all works right now,I randomly allow through the Gamemode some AIs to surround the player and some to stay behind. The finding of free place is done with an Environmental Query looking for a place around the player that doesn’t have an overlap with either World static, dynamic and pawns.
My problem is that the characters don’t stay at their first designated area, but constantly switch places, resulting in a kind of sliding around motion. I tried to make the EnvQuery more central through the gamemode, such as it runs the EnvQuery itself and then assigns the positions, however this might result in overlapping positions since at the time none of the AIs are blocking each other’s positions. Also the editor became stupidly slow with this method, it seems that spamming the EnvQuery is a bad idea.
So the question is how could I preferably run the EnvQuery inside the Behavior Tree of the AIs and lock them to a correct position so that they don’t run the Query again, while at the same time they shouldn’t select the same positions as other AIs.