NavMesh change from walkable to NOT walkable at runtime
I have a bridge that has a navmesh across it - on it's own layer called "bridge". Because it is a small bridge I know how to mask out big vehicles and allow only pedestrians to walk it AHEAD of time - before I hit "play". I want to blow up the bridge in the game so nobody can go acrosss so I would like to know how to either 1)move that segment of the navMesh on the "Bridge" layer to the NOT WALKABLE layer - or to change the characters NavMesh Walkable layer to exclude the bridge layer at runtime. I have researched this but I get lost in all the in depth binary explanations of how it works. Anybody have that translated to code? like:
if(bridgeExploded == true)
SomeCharatcer.agent.areaMask = NavMesh.AllAreas.exccept the stupid bridge;
In the years I have tried this forum I have had but ONE person ever answer. Can someone PLEASE make my day and be that second person - or even that same very helpful person from the first and only time please come to my rescue again
Your answer
![](https://koobas.hobune.stream/wayback/20220612150708im_/https://answers.unity.com/themes/thub/images/avi.jpg)
Follow this Question
Related Questions
Understandable Answer to frequesntly asked question - clarified for noobs like me 0 Answers
Why does Nav Mesh Run Slower in build mode than in Editor? 1 Answer
Agent destination to last player position 1 Answer
Navmesh Agent trigger ? 1 Answer
Creating prefab through Zenject Factory makes navMeshAgent act strange 0 Answers