Thank you for the speedy reply —. Correct me if I'm wrong, this is what I understand from your event's sheet
- So you have a bunch of objects and have added them to a family group called 'Zorder'
- Assuming you have added 'Skin' to the 'Zorder' group.
- Then you have assigned an instance variable to the 'Zorder' family.
- Assuming this instance variable is a number with an initial value '0'
There are two parts to the Events Sheet
A) Assigning a 'Zorder' to the Skin / Player's Y position
B) Sort by Zorder Value
A)In the first set of condition ---
- If the Skin is present on-screen and
- If the Skin is on the layer called 'Character'
- Then Set ZorderFamily to the Skin's Self.y
B)In the second set of conditions --
- If the Zorder (Family of Objects) is present on-screen
- If the Zorder (Family of Objects) is on the layer called 'Character'
- Then tell the system to sort Zorder (Family of Objects) by Sort Z order by Zorder (Family of Objects) Instance Variable 'ZorderFamily(number) (i.e the instance variable is assumed to be a number)
Does this sound correct?
Here is the Zordersort.cpx file with the updated code but it's failing to sort correctly