Navmesh avoidance

Want to ask if it’s possible or how to use unity navmesh to do avoidance?

Let’s say enemy unit need to move from start to destination, and they are supposed to avoid turret places around the map, turrets have long shooting range, so enemy units should keep their distance, but if the entire map is covered by turrets, they still need to get to the destination, but going though the least amount of turret range.

Is that possible? Thanks.

It sounds like you have to weigh the paths and change their movement penalties. Something I believe you can do with the new API.

May I know what’s the so called api u was talking about? Give me a name for me to start Google please.

Are you using at least unity 5.6? What you could do maybe is use the navMeshModifierVolume.cs attached to the turrets so that it overrides the nav mesh area to a high cost area type.

oh i m using a much older unity, but thank you for your information, as long i have name to start google from, i should be able to do it, ill look into it after i update unity.