Multiple units overlapping in isometric game.

0 favourites
  • 4 posts
From the Asset Store
Pathfinding AI
$2 USD
80% off
Units do not overlap each other and use different ways if there are several free ways.
  • Okay, so the game has multiple people on screen at once, and I need them to be in front or behind depending on where they are. Naturally, the higher it is on screen, the further back it would be. Lower objects would be towards the front.

    It's an isometric perspective sort of like Baldur's Gate or whatnot.

    Here is some code I wrote that works when 2 people overlap, but gets confused if 3 people overlap at once. So, it works half of the time.

    Basically, I don't want someone higher on screen to end up in front or someone lower on screen to end up behind someone. It breaks the perspective rules.

    Surely, there is a better way to do this.

  • Try Construct 3

    Develop games in your browser. Powerful, performant & highly capable.

    Try Now Construct 3 users don't see these ads
  • There is a better way! You can do it in one event. Put all the objects you want Z-sorted into a family called IsoObject or whatever you prefer and set it up like this:

    <img src="https://imagizer.imageshack.us/v2/437x69q90/203/s7uq.jpg" border="0" />

  • Sweet, that's definitely a lot easier than the way I was doing it. Thanks! :)

  • ahr Ech,

    mind = blown

Jump to:
Active Users
There are 1 visitors browsing this topic (0 users and 1 guests)