Coder Social home page Coder Social logo

sharlatany / st2u2dnavmeshimporter Goto Github PK

View Code? Open in Web Editor NEW
11.0 5.0 2.0 3.85 MB

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: MIT License

C# 100.00%
unity 2d navmesh pathfinding 2d-navmesh navmeshsurface st2u super-tiled-2-unity tiled ai

st2u2dnavmeshimporter's Introduction

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

st2u2dnavmeshimporter's People

Contributors

sharlatany avatar

Stargazers

 avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar

Watchers

 avatar  avatar  avatar  avatar  avatar

Forkers

bmjoy hengle

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    ๐Ÿ–– Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. ๐Ÿ“Š๐Ÿ“ˆ๐ŸŽ‰

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google โค๏ธ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.