Search Unity

Tilemap and Navigation

Discussion in '2D' started by lofwyre, Aug 22, 2020.

  1. lofwyre

    lofwyre

    Joined:
    Apr 19, 2007
    Posts:
    174
    Surprisingly it is a bit confusing to create a 2D game with AI navigation. There is basic 3D navigation but the manual and official references around navigation for 2D seems to be missing.

    I'm looking for an AI agent solution. The A* Project works but is $100. Anything similar that has local avoidance and works in 2D?

    Thanks
    Matt
     
  2. Valjuin

    Valjuin

    Joined:
    May 22, 2019
    Posts:
    481
  3. spryx

    spryx

    Joined:
    Jul 23, 2013
    Posts:
    557
    A* is easy to implement on your own. That asset is going to be overkill for most people.
    I have my own A* solution posted here in the forum.
     
  4. lofwyre

    lofwyre

    Joined:
    Apr 19, 2007
    Posts:
    174
    Thanks Valjuin. I've settled on using this for now because it keeps me pretty close to Unity. Cheers.

    upload_2020-8-23_9-37-1.png

    Tilemap with Rule-Tiles where the full water tile has a 2D sprite collider set. Automatically picked up by the NavMeshSurface2D component. A regular NavMeshAgent on a 2D sprite can navigate on this with local avoidance etc.

    @spryx - A* isn't too hard but on large areas it's not as good as a navmesh and there are a number of other elements that I need that the default agent system has, like local avoidance. Considering Unity has already built half of it, I'd prefer that they just finish their basic implementation (for 2D). Cheers
     
  5. spryx

    spryx

    Joined:
    Jul 23, 2013
    Posts:
    557
    Understandable. I wasn't aware you were using it for large, open areas.
     
  6. lofwyre

    lofwyre

    Joined:
    Apr 19, 2007
    Posts:
    174
    All good mate, thanks for commenting, appreciated.