- Home /
Waypoints, avoidance, and general advice.
Ok so I'm going to start learning more about arrays (I know what they are for, I just have limited exposure to them) and I decided to do this using a waypoint system for AI.
I've got a general idea of how I want to attack this problem. I'm going to add waypoints using a array, then use a few raycasters for avoidance detection. Plan is if a ray fires off in relation to a player, stop current path, make adjustments to the right or left using another ray to the right or left, pass - once passed, move back to the same rough position past the player, pick up the last waypoint and start back towards it from the new current position...
Thing is I see a lot of people say "avoidance - without ray casters" so is this idea a taxing one? What about if I used some type of trigger instead to tell the AI to ignore the waypoint and to move left or right, pass, then when another trigger is hit, return to waypoint path (storing how far left or right the AI moved and then going back on the same, but opposite angle until lined up with the waypoint again)?
Just really looking for ideas and general advice for someone thats stepping into AI and waypoints so I don't make some critical mistakes. Either way its still just a learning experience I'm after on this one.
Thanks guys.
Answer by sparkzbarca · Jun 30, 2013 at 09:23 PM
look up A* pathfinding explained for a general idea of how a list (a kind of array really) is used in pathfinding. A* is a very popular standard method of pathfinding.
arrays aren't hard to understand though.
Arrays are a whole lot of one type of object and you can access each one of them in succession, they are all the same type of thing with different values and they are stored together for convenience.
you could make an inventory system instead (pathfinding is actually quite difficult)
I guess the main question was really more so in relation to not being to taxing if I was say. . Using 60 or so objects that all where using this raycasting waypoint method with avoidance.
Your answer
Follow this Question
Related Questions
Navmesh Agent avoidance with as triggers 1 Answer
Can't click gameobject when over another trigger? 1 Answer
OnTrigger ignoring all collisions but the first 1 Answer
Contact Triggered Waypoint 1 Answer
transform.collider.isTrigger problem 2 Answers