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?
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.