Search Unity

How to do Isometric Path finding

Discussion in 'Navigation' started by brettsaunders, May 31, 2019.

  1. brettsaunders

    brettsaunders

    Joined:
    Feb 28, 2019
    Posts:
    4
    I have been working from Unity's Isometric Tilemap based project to try to prototype elements for a game I plan on making. The one issue im having is how to do pathfinding, as I want to have AI that battle and shoot in squads.

    I looked into using Unity's Navmesh, but can't find a way to use it with Isometric?

    I also thought about writing my own A*, but not my area of expertise. I wrote a quick one where each tile is a node and it calculates the path. This, of course, leads to AI always moving from the middle of one tile to another. It also meant that the whole tile had to be unwalkable, which isn't the best because the unity isometric demo uses decorations that are Prefabs with colliders that can be placed freely. So doing this would limit those objects as AI couldn't go in any tile that contained an object.

    Any help, ideas or links to guides would be appreciated, thanks.
     
  2. Yandalf

    Yandalf

    Joined:
    Feb 11, 2014
    Posts:
    491
    Unfortunately Unity's core pathfinding solution isn't made with grid-based movement in mind. You will indeed have to roll your own, or perhaps use Aron Granberg's a* project (I am NOT sure if it supports grid-based movement, but it seems to be at least more complete than Unity's).
    The problems you're mentioning with decorations are simply how tile-based movement works. Take a look at old and new tilebased games (Fallout, XCom, ...), all of these force movement from centers of tiles to others.
    If you want decorated tiles to be walkable, you'll have to turn off colliders on the decorations. keep in mind you'll clip through any and all art assets.