Search Unity

  1. Looking for a job or to hire someone for a project? Check out the re-opened job forums.
    Dismiss Notice
  2. We are looking for your feedback about Templates! Tell us about your experiences by taking our survey.
    Dismiss Notice
  3. Good news ✨ We have more Unite Now videos available for you to watch on-demand! Come check them out and ask our experts any questions!
    Dismiss Notice

how to change navmesh agent Area mask through code?

Discussion in 'Navigation' started by TKDHayk, Dec 25, 2016.

  1. TKDHayk

    TKDHayk

    Joined:
    Dec 22, 2015
    Posts:
    95
    I need to change the area mask of my navmesh agent through code at runtime, to allow my agent to move to different areas of the map. How is this done through code? For example, I need to change the Nav mesh agent's area mask from "walkable" to "everything". Thanks.
     
  2. Jakob_Unity

    Jakob_Unity

    Unity Technologies

    Joined:
    Dec 25, 2011
    Posts:
    269
  3. IgorAherne

    IgorAherne

    Joined:
    May 15, 2013
    Posts:
    376
    convert layer name to layer int using NavMesh.GetAreaFromName()
     
  4. IgorAherne

    IgorAherne

    Joined:
    May 15, 2013
    Posts:
    376
unityunity