- Home /
Colliders and waypoints...
I'm trying to make multiple objects that when ran into by an AI character would have the character choose a new way-point within an array. It would be nice to have the AI be able to walk through the object in case I wanted to the AI to continue on to another object that does the same function. Where would I find out how to make this kind of script?
Answer by roamcel · Nov 02, 2011 at 05:50 AM
Using an a.i. might be overkill.
Since the logic behind your need is very simple, you could:
- store all the 'bumpable objects' under a controller gameobject in your scene
- add a script to the controller, which at start polls all its children and adds a 'newwaypoint' script to them if they don't have it
- in the collision or trigger functions of the 'newwaypoint' class, you use a function that calls the parent, and asks for a random (or specific) sibling
I believe this should be very, very efficient in comparison to using a more complex approach.
Your answer
Follow this Question
Related Questions
Waypoints using a Switch... 2 Answers
C# GameObject is not detecting collision with Character Controller 2 Answers
Need help with Flashlight Script 1 Answer
Destroy On Collision 4 Answers