- Home /
How do I make the minions path to the enemy base through the towers ?
i want make the path of minions to the enemy bath and attack all what they found in their way ( other minions - enemies heroes - towers ) I would be happy if u exactly showed me how to do that :)
Answer by Buckslice · Feb 06, 2018 at 03:42 AM
You can use Unity Navmeshes, Here is a link to the official tutorials about it. Basically you want to open the navigation window and build a NavMesh for your scene. Then you add NavMeshAgent components to your minion prefabs and in their MinionScript or what have you, add in some code that sets their agent.destination to the position of the next tower or whatever they need to attack.
If you want full RTS type game play though it is a fair bit of work. You could start with having each minion do an OverlapSphere check every once and a while to find the enemy closest to them and run to its position and attack it. Just try to start small and slowly add on more complexity in their behavior. Good luck!