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 :slight_smile:

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.

  1. 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.
  2. 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.
  3. Layers. Group similar objects into the same layer. Layers are useful as a performance optimization when doing physics checks.
  4. 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).

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.

Here is an example of a Zombie Motor, Controller, and ArtificialIntelligence that I created ; Enemy AI things to consider - Questions & Answers - Unity Discussions