- Home /
need help with AI
Hi,
I need help with ai so Im traying make a zombie game with ai/characters example: left 4 dead, the ai follow you and help you kill zombies, to go into a little detail the ai go around objects to follow you and have aimbot on zombies. I now this is asking for way to much especilly sins I dont now a lot about scripting I probubly sound like I wont you to wright me a script, inless your santa thats probubly not going to happen so im really just asking if you can give me some tips maybe tell me about a good youtube video or tell me what you now about one pacific thing like making ai follow you or how to make ai go around object or how to make them shoot something if you can help me in any why it will be much appreciated.
Thank you for your time :)
Answer by idunlop_oefun · Oct 05, 2012 at 05:08 AM
Sometimes it helps to know what to search for. Given this is a very large topic here are some general pointers to help you on your journey. Also, there may be several tools / scripts in the Asset Store that can help you.
Navigation mesh. This contains information that describes the walkable surface area of your game world. In other words, the AI's will know there is a wall here, some other obstruction or an open path. The API allows you to perform a search on this navigation mesh and generate a path that gets an enemy from A to B.
Properties. Attach a script or data to characters in your game. The purpose is to define some basic information for your objects, e.g. a property might say "I'm a zombie" or specify an amount for how much health the zombie has.
Layers. Group similar objects into the same layer. Layers are useful as a performance optimization when doing physics checks.
Physics Overlap Sphere and Raycast tests. Do a sphere check to determine if there are any zombies within range of your AI characters. Then perform ray casts from ai to zombie to determine if they are in line of sight. At that point via scripts and animation create a "shoot" state that fires a bullet (probably a raycast).
thank you vary much now I know what im really looking for, you helped me a lot. :)
Answer by softrare · Oct 05, 2012 at 07:14 AM
You say you don't know much about scripting. I think it this is actually the only problem. Learn some basics, search on google, there are thousands of very good sites. If you know the basics and you are comfortable with them, you will instantly make up ideas how to get to the solution yourself. This is generally a way better idea then to ask for some scripts, maybe they work, maybe not, and even if they do, you won't know how to use them. If you learn for yourself, make up ideas "maybe it would work like that, or like that" then you will know with what you are dealing, and if you have specific questions, you will most probably get a precise answer here.
thank you I will learn more about scripting, right now im learning HT$$anonymous$$L on a website called tizag it $$anonymous$$ches you on how to make a website but do you know of any good unity scripting tutorials.
Learn the basics of program$$anonymous$$g first, what are functions, classes, loops, conditions, really if you type "program$$anonymous$$g basics c#" in Google then it will give you more than you can read. After that focus on something specific in unity. I have seen great tutorials for character movement, colliders, and many things. Google is your friend, type "Unity3d AI tutorials" or something which interests you most to get a grasp of solutions that others thought of, and you'll know how to use them, because you learned the basics. But maybe this won't even be neccessary because if you learned the basics, solutions will pop up in your $$anonymous$$d, and you will probably be eager to try them out. If they don't work, never fear, this forum will probably help you out with any specific problem! I wish you a lot of success!
ok cool thank you vary much I will start out small at first.
Answer by Montraydavis · Oct 27, 2012 at 03:47 AM
Here is an example of a Zombie Motor, Controller, and ArtificialIntelligence that I created ; http://answers.unity3d.com/questions/337837/enemy-ai-things-to-consider.html
Your answer
![](https://koobas.hobune.stream/wayback/20220613081911im_/https://answers.unity.com/themes/thub/images/avi.jpg)
Follow this Question
Related Questions
How would I confine an object to the ground? 2 Answers
AI help people 1 Answer
Send an enemy back to its spawn point using waypoints 2 Answers
How to make this enemy script shoot upwards? 1 Answer
Reinforcement Learning in Unity 0 Answers