Skip to content

ST2U2DNavMeshImporter is a Unity Package that provides a custom importer to automatically setting up 2D Navmeshes (Using NavMeshSurface2DBaker) when importing "Tiled" tilempas through SuperTiled2Unity.

License

SharlatanY/ST2U2DNavMeshImporter

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

10 Commits
 
 
 
 
 
 
 
 
 
 
 
 
 
 

Repository files navigation

ST2U2DNavMeshImporter

About

ST2U2DNavMeshImporter is a Unity Package that provides a custom importer to automatically setting up 2D Navmeshes (using NavMeshSurface2DBaker) when importing Tiled tilempas through SuperTiled2Unity.
The importer automatically creates a NavMeshSurface with the correct position, rotation, size and all the necessary components.

All that's left to bake your NavMesh after importing the tilemap is the press of a button!

Prerequisites

Usage

  1. In Unity, go to your tilemap and set Custom Importer to CustomImporter_2DNavMesh. Alternatively, if you want to generate NavMeshes for all your tilemaps, uncomment the [AutoCustomTmxImporter] attribute in CustomImporter_2DNavMesh.cs
  2. On the ST2U Settings object, press the "Reimport Tiled Assets"-Button.
  3. In the scene where your tiled map is being used, search the tilemap object for a "NavMesh" child and select it.
  4. On this child, there's a Surface2DBaker component. Press the "Bake 2D"-button on this script to generate the NavMesh.

FAQ

What collider types are being supported?

  • BoxCollider2D
  • CircleCollider2D
  • PolygonCollider2D
  • CompositeCollider2D
  • TilemapCollider2D (For those to work, you have to make them part of a CompositeCollider2D, though!)

Baking takes a really long time, even for a small map, why is that?

Your NavMeshAgent radius is probably way too small. Experiment with the radius until you find a radius that's as big as possible while still giving you accurate results.

The resulting mesh is very inaccurate, why is that?

Your NavMeshAgent radius is probably too big. Experiment with the radius until you find a radius that's as big as possible while still giving you accurate results.

Is there a way so I don't have to press the bake button?

Not at this moment, unfortunately. At the moment I don't see a clear solution for this which I could implement in a clean and simple manner. Figuring this out would probably take some time I'd rather spend on other projects as long as there's no need for it. But let me know if that's a must have feature for you and I'll see what I can do!

Compatibility

Current version tested with:

  • Unity 2019.1.0f2
  • SuperTiled2Unity 1.1.9
  • Unity NavMeshComponents 2018.3.0f2

3rd party components provided with project

About

ST2U2DNavMeshImporter is a Unity Package that provides a custom importer to automatically setting up 2D Navmeshes (Using NavMeshSurface2DBaker) when importing "Tiled" tilempas through SuperTiled2Unity.

Topics

Resources

License

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published

Languages