How do I set Z order by Y expression?

Get help using Construct 2

Post » Fri Nov 14, 2014 1:52 pm

Hi!
I have 6 objects in a family which they overlap several times. And I want objects with higher Y to be on top. I tried many ways but I couldn't find a way that works...
Could you help me on this to find an algorithm?
B
14
S
4
G
2
Posts: 91
Reputation: 2,430

Post » Fri Nov 14, 2014 3:33 pm

Use For each(ordered) to loop through the objects in your family, set the expression to Family.Y(Replace Family with whatever your family name is), order by ascending, and then add an action to send the current family object to the front. This will send each of your family objects to the front in turn, starting from the object with the lowest Y value, resulting in the ordering you want.
Moderator
B
113
S
41
G
20
Posts: 1,586
Reputation: 19,116


Return to How do I....?

Who is online

Users browsing this forum: ultrafop and 18 guests