Forum rules - please read before posting.

Layer Order Problems with Isometric view

edited October 2022 in Technical Q&A

Greetings!
I am trying to make a game with an Isometric view like shadowrun, but the Layer Order is creating problems within bigger areas. I really dont know how to code or work around that problem...
I know the Adventure Creator isn't optimal for this angle but if there is a chance to do it without clipping problems, i have to take it.
I'd really appreciate some help or maybe even a solution that i've overlooked.

Pictures:
https://ibb.co/dtPw20d
https://ibb.co/7rCX7ph

Comments

  • edited October 2022

    Welcome to the community, @Roysinatra.

    AC's 2D sorting is intended more for the "head on" perspective, where sorting between two sprites is essentially determined by their relative position along the Y-axis.

    Sorting sprites in an isometric perspective is a deceptively complex topic. For "point" sprites like the Player and the street post, relying on a simple Y-axis sorting is enough. However, when it comes to "long" sprites like the barriers, the X-axis is also a factor when determining drawing order.

    For isometric sorting, you'll need to forego AC's Sorting Map and replace it with a separate sorting algorithm. Since character's don't scale with an isometric perspective, you can remove AC's Follow Sorting Map component from your character(s), which will allow their sorting orders to be controlled by other means.

    Setting Unity's Transparency Sort Axis (available in the Project -> Graphics settings) to (0,1,0), and setting your Sprite Renderer's Sprite Sort Point to Pivot will get things looking right for "point" sprites mentioned above. To account for "long" sprites as well, though, you'll need to bring in a separate package / custom script.

    There are options out there - see this one in particular, which has a link to a Github project you can pick apart and should be able to make use of by attaching its "Iso Sprite Sorting" component to your various scene sprites.

    For background sprites, such as the buildings, which will always be drawn underneath the Player etc: place these on a new Sorting Layer that's set to display underneath the default. These don't need to be sorted, since they'll always be drawn underneath.

  • Thank you, much appreciated!! :D
Sign In or Register to comment.

Howdy, Stranger!

It looks like you're new here. If you want to get involved, click one of these buttons!

Welcome to the official forum for Adventure Creator.