Hi
I have a problem with the navmesh agents all following the same path, I know this is intended but how can I make some of the agents take a different path to their target?
I have 3 agents, Cubes all in the same position, they all take the same path. I want them to take different paths.
I hope I was clear enough for you guys, Thanks
Why do you want them to take different paths? Is it because they are interpenetrating with one another or for some visual diversity? In the former case, you should use dynamic obstacle avoidance on top of the base nav mesh.
I am just trying to get more of a visual diversity witch will in turn help make the game a little more challenging and less predictable
For regular visual variety, nav mesh isn’t the best tool, but you can try using different layers with different costs. If the costs are different enough between units, they will take different paths. Otherwise, it’s better to do something at the AI level, like different intermediate goals that are guaranteed to follow different paths.
I think you can use Avoidancepriority (agents avoid each other while moving). For a more controlled and robust approach you should use dynamic obstacle avoidance as @MakeCodeNow suggested.
youll have to come up with your own waypoint system if you want them to take a random path.
Instead of going directly to the destination, make them go through intermediate destination before and randomize them.
For example, the cubes must go from source A to destination B. Specify in advance intermediate destination C D E F G each on a different path, then each cube will go from A to random (C D E F G) and from there to B.