HI! well i will ask quickly, i have to do a final exam and i have to do a Tower Defense, the problem is…i know how to do the Astar, i have it, and i tested it and its work, but the question is… Who can i incorporate it to an enemy? (example, a prefab that its a cube) so the cube will go from the start to the goal node. Thxs!
pd: i tried to download Angryants but it doesnt work :S (for me)
If you are looking for an A* Plugin that handles the algorithm already, check out Aron Granberg’s Pathfinding Project (There is a free version). I use it for a tower defense-like game, and it is really excellent. The documentation is great, and it is up-to-date. I dont think AngryAnt’s path is really usable anymore in the latest version of Unity, and I think the next version of Unity will have pathfinding incoorporated into it.
If you want to implement your own A* Pathfinding library, you could represent your nodes as an array of Transforms, which you position using the Editor. The implementation itself would be regular, fun-filled A* :). As for using it on a specific character (eg. the enemy cube you mentioned), it should be clear from your implementation itself how to do this, but it basically finding your cube’s closest node, finding a path to your goal node (stored as a list of waypoints), and continually moving towards the next waypoint until you reach your goal.