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.
Up to 2 attachments (including images) can be used with a maximum of 524.3 kB each and 1.0 MB total.
The best place to ask and answer questions about development with Unity.
To help users navigate the site we have posted a site navigation guide.
If you are a new user to Unity Answers, check out our FAQ for more information.
Make sure to check out our Knowledge Base for commonly asked Unity questions.
If you are a moderator, see our Moderator Guidelines page.
We are making improvements to UA, see the list of changes.
Answers and Comments
No one has followed this question yet.
How to make a world model apear seperate from a player model
How do I make my fps character grab objects?
Monster doesn't move
Freelancer of Freespace type Enemy Ai
shooter adjust where fired