- Home /
How To Make Basic AI?
Okay, so I have a first person shooter set up, with a map and a character, with animations, grenades, multiple guns, etc. I am NOT using the MachineGun.js script unity includes in there FPS tutorial. I wrote the whole script from scratch myself. I am using a lot of the assets from the bootcamp demo, and I want the enemies to be the soldier you play. I have the model setup, and I have all the animations. All I want to do now is have him stand there (or possibly patrol a path), and when you get within a certain distance from him, he will maybe run and hide, then a few seconds pop out and start shooting, or something. The games pretty much finished except for enemies. you can pick up ammo, and there are plane crashes and stuff like that, so I want it to look good. Possibly, could someone explain how to use Behave (and exactly how it works), because I can't find any good tutorials. (Also, I already have it installed and ready to go. Its version 1.12 I think)
Answer by PrimeDerektive · Feb 09, 2011 at 07:09 PM
As far as I know, Behave is just a drag and drop solution to easily create finite state machine structures, but you still have to code by hand the actual behaviors that are supposed to occur in each state.
I would dissect the AI scripts from the various tutorials from the resources section of Unity3d.com, both the 3rd person platformer and the FPS tutorials have basic AI behaviors that can get you started with a basic patrol/chase/attack bot.
Answer by Zeyad Tuffaha · Feb 10, 2011 at 11:37 AM
As mentioned above, you can use the scripts from the Unity FPS tutorial. I have created a FPS game and used the scripts on my AI and it's great.
The scripts are "AI (which automatically assigned a character controller), AIanimation (which allows the AI to animate) and you can also assign a damage receiver or something. It's all there in the tutorial, all you have to do is drag and drop.
It also has a waypoint finder, you only move the waypoints around and the AI will follow automatically.
The problem is, is that the scripts are just much too different. It would require me to basically break down their entire script and pretty much redo it. I guess I will just look at theirs and make a new script from scratch, using some of their code.
Answer by Stib · Feb 09, 2011 at 08:49 PM
If you want to learn how to make a great game AI, read Programming Game AI by Example. The book is geared toward creating First Person Shooter behavior.
Here is a good plugin, it may help you.
https://www.assetstore.unity3d.com/#!/content/87744?aid=1101l34jr
Your answer
Follow this Question
Related Questions
How do I make my fps character grab objects? 4 Answers
Monster doesn't move 0 Answers
Mecanim Fps Shooter? 3 Answers
shooter adjust where fired 0 Answers
First Person Shooter Prefab not working 0 Answers