- Home /
Zombie A.I path finding help
HI, is there a way to make a zombie ai script ( Path finding ). I know that i'm asking for a lot, but if there are and tuts avialible please tell me about them. Also if u can tell me ho to get started with learning JavaScript, please tell me ( as i only know to very basics) . :)
Ok well I just wrote a tutorial on pathfinding on Unity Gems - but it's in C# and believe me - it's not easy :)
UG is planning a simplified version of pathfinding and co-author Fafase is on that right now - but that also cannot really be beginner level.
You can get, for free, Aaron Grandberg's AStar Pathfinding Project - which will probably do what you want.
If you are beginning with AI then Unity Gems does have some very useful articles on how to get started.
Answer by GameTech · Jan 05, 2013 at 01:14 PM
I am making my own pathfinding using very easy to understand algorithms, as a new programmer I can tell you it is easy but not optimised. It is easy on calculations imo though. It uses waypoin ts and charactercontroller to avoid obstacles. I suggest this way as using navmeshes and A* require some thinking and seems to hurt performance as they are more accurate. Having few points and setting them in a path array seems cost efficient.
If you actually posted some information (example code or at least an explanation of what you're doing), this might even be an useful answer.
As someone who is also learning javascript basics, my code is not very refined at all. So basically, way points = transforms that are connected to other transforms by array, the transforms next to each other in the array are in straight paths to each other. Just have the zombie ai use transform.LookAt(waypoint) and charactercontroller.move(transform.forward*(whatever your movespeed)*Time.deltaTime) to get to each transform. That allows the zombie to follow a path. If you want it to chase a player in a maze for example, you would iterate through the array and use Vector3.distance(waypoint,Player) to find the closest waypoint, have the iteration place the path into the path Transform Array for the zombie to follow.
Go through Unity javascript tutorials for complete projects. They might have some in the Asset store, there are some C# examples at least. I suggest learning javascript and then learn C#.
Thanks but I found Eteeski was very helpful with his tutorials and so I had a crack at them. Works alright but is a bit glitchy sometimes. Thanks though. :)
Your answer
Follow this Question
Related Questions
Need help with javascript AI 1 Answer
Attack Script problem please help 1 Answer
looking to make for a zombie script AI,navmesh or not? 2 Answers
How can I get an object to intercept a moving object's path? 3 Answers
zombie enemy AI 1 Answer