Z Layer/Instance of Object help

Get help using Construct 2

Post » Sun Feb 12, 2017 7:49 pm

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?
Oh, okay.
B
23
S
5
Posts: 39
Reputation: 1,251

Post » Sun Feb 12, 2017 8:17 pm

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
B
33
S
18
G
28
Posts: 2,493
Reputation: 20,950

Post » Sun Feb 12, 2017 8:21 pm

@99Instances2Go Thanks, it worked.
Oh, okay.
B
23
S
5
Posts: 39
Reputation: 1,251


Return to How do I....?

Who is online

Users browsing this forum: puntodamar and 7 guests