how to force units to surround the enemy?

hello i am new to UNITY3D and i have a problem. I don’t know how to force my units to surround the enemy. I want to end up with something like a system from warcraft 3 https://i.gyazo.com/90d3a0ec82a41f53c831b00c403dc7df.gif (sorry for the quality)

how to create something like this using navmesh unity? I got a few ideas 1. use local avoidance, but I have no idea how to do it with navmesh, I heard about switching navmeshagents to navmeshobstacles when the object stops, but it seems to me that it will work crookedly. 2.use Attack Slot System like this https://www.trickyfast.com/2017/10/09/building-an-attack-slot-system-in-unity/ which also does not look like a system from warcraft 3

please help to achieve a similar result with warcraft 3, and if it’s not difficult for you, help with the code (sorry for machine english)

I want to add that if you do nothing, then the units simply accumulate at one point next to the enemy.

That’s pretty much what you have to do: tell agents to move to different positions if the one they want is occupied. The example you linked looks a little too rigid, but the concept is sound.

1 Like

Thank you