Z Layer/Instance of Object help

0 favourites
  • 3 posts
From the Asset Store
Hand-painted tiles, objects, animated objects, and background to build a colorful Mayan civilization environment.
  • So... I'm making a little Isaac/Gungeon style game. I'm doing pretty good so far, it's working out great. However, I am experiencing a graphical glitch involving the Z layer. I'm not sure if I'm doing this right, but I have two events, "compare y of player to npc, if player y is greater than npc y, move in front of npc" and "compare y of player to npc, if player y is less than npc y, move behind of npc"

    This might not be how it's done though. I've tried "for each" but that doesn't work. ONLY the first instance of npc functions properly. All others don't follow the "if player y >/< npc y" event.

    I saw someone post something similar to this a while ago, but the "solution" also didn't really help. I'm out of ideas. Anyone know what to do?

  • Try Construct 3

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

    Try Now Construct 3 users don't see these ads
  • Assuming that there is only 1 player.

    System > pick by comparison ... object = NPC ... Expression = NPC.Y .. less or equal .. value = PLAYER.Y

    _____action ... NPC > move to object .. Where = behind .. object = PLAYER

    System > pick by comparison ... object = NPC ... Expression = NPC.Y .. greater than .. value = PLAYER.Y

    _____action ... NPC > move to object .. Where = in front .. object = PLAYER

  • 99Instances2Go Thanks, it worked.

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