2D NavMesh Plus - Components and Extensions System

Hi All,

Introducing to public (Unofficial) 2d NavMeshComponents for Unity.

2D NavMesh Plus

NavMesh Plus [Git] - This repository is fork of [Unity NavMeshComponents] enhanced with Extensions system for 2d Pathfinding and more.

Features:

  • Implements source collector of tiles, sprites and 2d colliders
  • Supports both mesh and collider sources
  • Rectangular, hexagonal and isometric tilemaps
  • Runtime bake optimizations

References:
NavMesh Plus - [Demo] [Samples]
NavMeshComponents - [Git]
Documentation and samples - [Wiki]
Additional links - [Old Thread]

This thread is dedication for help and collaboration on topic.

13 Likes

Components & Extensions:

  • NavMeshLink

  • NavMeshModifier

  • NavMeshModifierVolume

  • NavMeshSurface:

  • NavMeshCollectSources2d

  • NavMeshCollectRootSources2d

  • NavMeshCacheSources2d

Utilities

  • NavMeshExtensionsProvider.cs

  • NavMeshBuilder2d.cs

  • NavMeshExtension.cs

  • NavMeshBuilderState.cs

FAQ:
Q: How to change NavMesh padding?
A: Navmesh draws where the center of the Agent can reach, not his edge. Reduce Agent’s radius to get navmesh closer to the edge. Bake again to see results.

Q: How can I connect two NavMeshes together or point to the agent that there is a “jump” between?
A: With NavMeshLinks you can connect NavMeshes or place triggers for certain actions like: jump, open a door.

Q: Can I make a passage that is blocked to be walkable after certain action?
A: Yes, you can update mesh at runtime, or use NavMeshObstacle

How can I increase the amount of space the NavMesh generates on my path? Ideally I’d like it to more closely stick to the sides of the road. I am using Isometric 2D tilemap.

Hello @julesx

Thank you for feed back. This question is poping more times that I’m expected, here is references with details and explanations How to change Mesh padding? · Issue #67 · h8man/NavMeshPlus · GitHub

Share your thoughts on how we can improve documentation to avoid this situation again.

the link provided https://docs.unity3d.com/Manual/class-NavMeshSurface.html is dead

when I look at the settings for NavMeshSurface directly, the only setting that seems to apply is “Override Tile Size” - changing it doesn’t seem to have any effect on the baked mesh. Trying both 1 and 1000 makes no difference.

i don’t understand how smooth cornering or the nav mesh static methods relate to the baked walkable area being smaller than the visual path

@julex, try to change Agent radius and Bake again
https://github.com/h8man/NavMeshPlus/issues/40

Hello! First of all, thank you so much for making this! You’re a real lifesaver. I’m here to ask, is there a feature to merge 2 NavMeshes if they overlap on top of each other, has the same default area, geometry source, and same layers included?


I’m planning to use this on a very big map, that’s why I planned for each Monster to have their own NavMeshSurface, limited by volume.

Hello @Aryazaky ,

You cannot just stitch together two navmeshes, but you can:

  1. inter connect navmesh with a link. NavMesh Link - Unity Manual
  2. runtime bake area that is currently loaded

The sample scenes with links and runtime bake are here:

Samples specific to NevMeshPlus are here GitHub - h8man/RedHotSweetPepper: 2D Navigation Click-To-Move Top Down Run and Chase Game "RedHotSweetPeper"

Hi @vhman
Right now I’m having a problem I can’t find the cause of.
When I instantiate a gameobject sometimes it gets instantiated with its x rotation set at -90, I’m just wondering if anybody else has had this problem or if it’s even possible your extension can be the source of this problem.

I have my NavMesh2D which is also rotated -90 on X, but it is not a child and it has no children, so from my pov it’s not causing it, it’s just odd that my problem is also -90 on X.

Hi @vhman
first, thx you for make NavMeshPlus.

When I use NavMeshPlus in Unity 2021.1.21f1
And follow your start SOP.
But When I click the bake , nothing happened…
I try to using in Unity 2021.3.1f1 , it’s working!

do you know why i can’t use NavMeshPlus in Unity 2021.1.21f1?
and how to fix it?

@shuhungchu

I found that if NavMeshCollectSource2d added first and NavMeshSurface after - it will not work and no error displayed. I planning to improve setup experience, but I always don’t have spare time to do it.

So add NavMeshSurface first and NavMeshCollectSource2d after. Enable components Debug view and verify that NavMeshCollectSource2d has NavMeshOwner.

@vhman Thank you ,Man!
I enable the debug view and check NavMeshCollectSource2d has NavMeshOwner.
It’s work!!!

Very Very Thank You!

1 Like

Hi @vhman
first, thx you for make NavMeshPlus.

i found that move agent vertical would be jittery.however other direction move has no such problem.
i used unity2021.3.4f1.

how to fix this?

thank you

Hello @infinitudegame

Its known issue HOW TO · h8man/NavMeshPlus Wiki · GitHub
Also you can find many closed items in GitHub with the same issue and details.

This Unity bug\feature.

Hi @vhman
Thank you very much!
I have read the known-issues.But here is a weird thing happen.
I setup a new test project, that i didn’t ajust x. the agent will get stuck while moving on Y axes in editor mode.However i build and run the agent were moving smooth on Y axes.That’s incredible!
I have attached the project here!You can check it!

8318148–1091652–TestNavmeshPlus.7z (254 KB)

2 Likes

This asset looks great! Thank you so much for sharing it! Would this work with a 2D builder/RTS game where objects are added to, and sometimes removed from, the scene over time? Does it update the navmesh as obstacles are added/removed?

@OldRod , Hello.

Yes, navmesh supports dynamic updates to the mesh. Refer to these sample projects:

General samples for navmesh: NavMeshComponents/Assets/Examples/Scenes at master · Unity-Technologies/NavMeshComponents · GitHub
Samples specific to NevMeshPlus are here GitHub - h8man/RedHotSweetPepper: 2D Navigation Click-To-Move Top Down Run and Chase Game "RedHotSweetPeper"

But navmesh doesn’t support group management for RTS out of box.

Hey, this is an awesome asset!

I have a question for an issue I cant quite figure out, can this generate a navmesh that spans multiple tilemaps?
At the moment, I can only make a navmesh for each tilemap. Was just wondering if Im doing something wrong ^.^ haha

@nwstory Hello,

Yes, you can build mesh from multiple Tilemaps, just add navmesh modifier to each HOW TO · h8man/NavMeshPlus Wiki · GitHub