Search Unity

  1. Megacity Metro Demo now available. Download now.
    Dismiss Notice
  2. Unity support for visionOS is now available. Learn more in our blog post.
    Dismiss Notice

Custom NavMesh?

Discussion in 'Editor & General Support' started by Kemp-Sparky, Aug 18, 2020.

  1. Kemp-Sparky

    Kemp-Sparky

    Joined:
    Jul 7, 2013
    Posts:
    72
    Hello!

    I have been trying to find a simple solution for gravity agnostic pathfinding. Basically, I want NavMesh Agents to be capable of walking on arbitrary surfaces, like spiders or gravboots. The only solutions I can find suggest either using a completely separate pathfinding system (which I'd rather not do), or reorienting the meshes you want to be walkable and baking new NavMeshes on the side now facing up, as many times as it takes to make all the surfaces walkable. That's not too bad for a box, I guess, but this is problematic because some of the surfaces I want to make walkable are complex, and would take several bakes, and there are alot of different climbable objects I want to use.

    I would like to be able to either tell Unity to bake NavMeshes without regard for the ground normal, or to just import an externally authored mesh that I can assign as the NavMesh.

    I can't seem to find out how to do either of these things, which is quite surprising to me, since that seems like a pretty basic feature. I feel like I've just missed it in the documentation. If anyone could point me in the right direction, I would appreciate it very much indeed!

    Thanks!
     
  2. dgoyette

    dgoyette

    Joined:
    Jul 1, 2016
    Posts:
    4,193
    What you're trying to do sounds almost exactly like one of the demos Unity made of Nav Mesh Components:



    Nav Mesh Components are a github repo that extends/improves/(replaces?) Unity's built-in Nav Mesh. Maybe that's what you're looking for.
     
    PraetorBlue likes this.
  3. Kemp-Sparky

    Kemp-Sparky

    Joined:
    Jul 7, 2013
    Posts:
    72
    Thank you for the reply!

    I did find this video while I was looking for what I want, but, while it does have walking on walls and ceilings, it doesn't actually bake navmeshes on complex geometry. The navmesh is still just the floor of each tile, based on each tile's local up vector. The complex geometry on each tile (the walls) is still not walkable. In the video he responds to a question by someone looking for what I want with the "lots of bakes stitched together with lots of links" solution. He does also mention that it is possible to write your own implementation of NavMesh generation, but I can't find any documentation on that.
     
  4. DHRUVdada

    DHRUVdada

    Joined:
    Feb 26, 2020
    Posts:
    1
    Did you find any solution for your problem.
    I also want to bake custom nav mesh for complex geometry but i don't understand where to start.