Search Unity

Question Retrieve nav mesh triangulation for a specific agent type?

Discussion in 'Navigation' started by PineTreeDev, Jan 13, 2023.

  1. PineTreeDev

    PineTreeDev

    Joined:
    Apr 22, 2019
    Posts:
    31
    Hello, I am building an editor tool to bake in nav links for some of our custom agents that can walk on walls and change planes.

    I would like to retrieve the triangulation data of the nav mesh but only including the surfaces that where baked for that specific agent type. I am well aware of the NavMesh.CalculateTriangulation() method, having my system setup with that data at the moment, but it gives me erratic spawns using every agent type surface.

    Ive tried updating the NavMesh using RemoveData and AddData for my specific surfaces but it makes no difference

    Is it something that's possible within the current API?
    Thanks in advance!
     
  2. PineTreeDev

    PineTreeDev

    Joined:
    Apr 22, 2019
    Posts:
    31
    Ok, maybe I wasn't well informed enough on the Nav Mesh system, but if you deactivate surfaces the nav mesh triangulation updates in the same editor frame to not include those innactive surfaces. So when I want to get specific agent type surfaces I disable all of the others, get the triangulation and restore the previous state