Search Unity

Skewed Isometric Grid

Discussion in '2D' started by unity_mxTWsrmALoWtFQ, Aug 23, 2020.

  1. unity_mxTWsrmALoWtFQ

    unity_mxTWsrmALoWtFQ

    Joined:
    Aug 25, 2018
    Posts:
    11
    I'm fairly inexperienced with Unity, but I've spent a lot of time trying to solve one specific issue: Creating an Isometric grid that has different angles than the ones offered by the 'tilemap' feature:

    The x-axis is horizontal, while the y-axis is skewed (as seen in the picture above). I tried to use the tileset at first, but realized it would only work with certain angles (unless rotated), so I figured it's just not the right solution. Doing it without a tileset, by just placing the graphics accordingly, is no problem - the real problem is the sorting order of all objects: I can't figure out a way to make things work out.

    To clarify, game objects can't just move back and forth, but up and down as well (otherwise, it would be easy, since I could simply order by the y-axis).

    I lack the experience with Unity to know if there would be an easier solution than me trying to write some custom ordering mechanism (or to know the proper way to do so), but I figured before I continue to break my head over this issue, I might ask if someone already solved it in a game with similar perspective.

    As far as I've tried, I made following realizations:
    - Using the Unity tilemap editor doesn't seem to be the right solution, due to the need to rotate the whole thing (and probably causing other issues down the line)
    - Transforming the x and y coordinates from all objects into one "order" number that retains the order doesn't seem possible (or I just don't know how). It's easy to do with either just X, or just Y - but not with both combined.
    - My only idea at this point, is to re-order all objects manually in each frame... which doesn't sound like a solution at all, and I would like to avoid that.

    Any ideas? Do you know any open-source Unity projects that implement a similar perspective, or any other tricks or things I could use? Is there a way for me to write a custom order algorithm to overwrite the existing ones? Or a new type of Tilemap?

    I've lost far too much time on this problem, I'm thankful for any help :)
     
    guaralism likes this.