- Home /
Enemy AI help
Hi guys, just wanted to say before I start that Im sorry if this is a rather large request, Im an 'artist' (air quotes) and so I cant really do coding, but Im slowly trying to learn around my current stuff going on. Also, if you cant help me yourself, a link to an asset store thing that can do what I want without coding is absolutely fine...
Okay, so now we got that out the way, Im trying to create some enemy AI and Im having a lot of trouble, I was wondering if you guys knew any, or even if your feeling generous write me, or find me an asset store link to, an AI script. Its somewhat basic, so at least thats something.
Okay, so I need it to patrol randomly in a formation (I guess this could be done by grouping units in an empty gameobject and keeping them in the order I placed them in originally, but what do I know). By randomly, I mean without waypoints, so they just walk around the map at random. But when they come close enough to one of 2 types of enemies (So I want them to attack the player, but also another army, so they need to attack both), which one they attack I dont mind whether its random or whose closest, I gotta give you some leeway. Because of the attack, it needs to have a basic health and shooting system, where each one unit fires 1 shot every 10 seconds ish (its supposed to be very slow, its a musket), and if even better if they run into the enemy and melee attack if within a certain range. It doesnt need any animation system or anything, just what I said above. So far, I just have a third person controller for the player, so if it needs a corresponding script to work with the player for health and being shot, just have that as a basic health system and so it shoots every 10 seconds when clicked.
Sorry for the high demands, as I said Im lost when it comes to coding but I want to make this game, and I'd rather do it alone (being in a team forces you into a certain commitment, and I dont have the time or the confidence in my own skill for that at the moment).
Thanks so much for any input
Answer by Raiden-Freeman · Dec 07, 2013 at 12:40 AM
Don't be scared of programming. It's easy. You just need to really divide your goal into much much smaller ones and achieve them one by one.
If you're looking for some tips on AI in C#:
And in UnityScript: (quite explanatory) http://youtu.be/i3HunQfX5fA http://youtu.be/KD0kLCZNQlc http://youtu.be/ooRajiKbOIU
And this guy who has the scripts ready to download: http://youtu.be/FMyVTXs1g94 http://www.youtube.com/watch?v=NFrkbe6Ltd4 http://www.youtube.com/watch?v=jj4zolt3Auk
I recommend that you familiarize yourself with C# and not UnityScript, because even though it may seem tougher for you at the beginning (go to MSDN for ANYTHING you don't understand, there are also insane resources explaining EVERY term, google ahead :) ), it will prevent you from making mistakes, help you create much much more organized code, which will be easier to manage the larger it gets. Plus you're learning something not only applicable to Unity!
Good Luck!
Oh I am learning program$$anonymous$$g, I just dont have much time to do that alongside all my other stuff, and the project I need this script for is just a little game jam thing Im doing :) Thanks for the help though
Your answer
Follow this Question
Related Questions
Multiple Cars not working 1 Answer
Enemy AI Help? 1 Answer
How to Stop Enemy "Shooting Through A Wall" 1 Answer
Enemy Spawn script not continuing level 2 Answers
Script to make an enemy follow the player when they trigger a door? 0 Answers