Hello,
I have a normal map with flat ground. There are couple of buidlings on the floor, which all have NavMesh Obstacle component. There are some tanks (NavMesh Agents) which need to navigate over the map. But those tanks aren’t avoiding obstacles correctly. When they come close, they start avoiding them, but some of them still hit obstacles. Is there any alternative to NavMesh system, that calculates path more accurately ?
Regards, L
Pathfinding and local obstacle avoidance are two different aspects of the NavMesh Agent - have you read: https://docs.unity3d.com/Manual/class-NavMeshObstacle.html ?
Old thread but the issue for me was that NavMeshObstacles don’t affect agent paths by default (odd choice); they only act as colliders, so my agents were bumping and sliding and even slipping through locked doors trying to get into sealed off rooms. Not sure this is ever useful behavior, but:
Once you tick the “Carve” box on a NavMeshObstacle, that means it’ll carve out a hole in the navmesh and agents will no longer try to walk straight through locked doors and other obstacles.
12 Likes
Hey Sarah, to shed some light on this: carving is a relatively expensive operation you generally want to avoid doing over and over again.So the obstacles turn off carving by default under the assumption your obstacle is a moving body (something like a rolling barrel) with the idea you’ll manually turn carving on when it settles and turn it off again when it begins to move.
1 Like