Local Avoidance Issues

I’m having some problems trying to get local avoidance working. It just doesn’t seem to want to work. I’ve tried following the documentation for it. I’ve tried adjusting the simulator settings, but nothing seems to work. It just collides inside the obstacle and stops. Sometimes it’ll try to go to the right and get stuck due to limited space, but never tries to go to the left where there’s nothing blocking it.


Hi

Local avoidance only uses extremely local information. In this case it seems a wall in front of it, but no alternative direction seems to take it any closer to the goal. You probably want to update the graph instead so that it can plan a path around the obstacle.
Take a look at https://arongranberg.com/astar/docs/graph-updates.php for more information.
Since you are using a recast graph (based on your other thread) you probably want to use navmesh cutting to update the graph.
See https://arongranberg.com/astar/docs/navmeshcutting.php

Well, that’s a bit unfortunate then. I intended to use the graph updates for static objects, but I’m worried about performance issues if I do that semi-often with dynamic objects, such as falling trees that react to physics.

It really depends on the game, but navmesh cutting can have quite good performance even if done relatively often.
When using navmesh cutting only the navmesh inside the tiles which had NavmeshCut components that changed is updated. So if the tiles are not too large and you only update a small part of the world at once I think it should be fine.
Falling trees for example I would expect to update the navmesh for a while while they are falling, but later become pretty much static, and if nothing moves then navmesh cutting doesn’t have much overhead at all.

Hmm okay, I’ve looked into it more and it seems kinda awesome, thanks.

1 Like