How do I set Z order by Y using Family?

0 favourites
  • 6 posts
From the Asset Store
With this template you will learn how to use the GooglePlay Games native plugin
  • I have a Function called Sort, it goes like this

    For each Object order by Object,Y ascending.

    Object Move to top of layer

    The above way is working the way it should. If I change 'Object' to a 'ZOrderFamily' it stops working correctly. I only have two different objects in the 'ZOrderFamily. If I remove the second object and only have the original 'Object' in the family it still doesn't work correctly. It doesn't Z-Order them correctly.

    For each ZOrderFamily order by ZOrderFamily,Y ascending.

    ZOrderFamily Move to top of layer

    All I did was change the Target Object to a Family and it stops working. I am not sure how else to Z-order using an objects Y than what I have. I can only assume 'For each' may be the problem since I went from an object to a family.

    I need to know what I am doing wrong. Nothing else is effecting the objects Z-Order because there is nothing else I have that can effect it. The only events associated with the objects are the ones used to create them. The 'Sort Function is called a tick after they are created (Wait 0 Seconds). All of the objects are on the same layer. The 2nd object will always be created between a few of the original objects, so they seemingly need to be Z-ordered together.

    Can someone please tell me what condition/expression to use or another way to do this so it works.

    Thank you for your time. I may have a slow reply, but it will be appreciated.

  • There is a new feature in the system action called sort Z-order by:

    add a family variable called Zy. Then create

    Is on screen:

    ---> set Family.Zy (variable) to Family.Y

    ---> sort Zorder by Family.Zy

    That's the easiest way.

  • I can't make this work with a family.

    Whatever i try, the instances get a new Z order number relative to each other, not relative to the members of the family.

    I would really aprecitate a working capx, Z sorting members of a family. A family that contains differend sprites.

    Not that it is a big problem for me. I use rex_zSorter by rexrainbow. And lately i am experimenting with the Isometric Behavior by R0J0hound. Both have theire (normal) problems with stacked objects. Wich i try to tackle.

  • So what condition do I use then? Setting the Family Variable and Sort Z Order are both actions.

    The condition I have organizes by ascending Y. I don't need that as a condition if Sort Z Order using the YVariable will be an action. Do I just leave it blank?

  • tunepunk

    Working isometric platform model.

    https://drive.google.com/open?id=0B1SSu ... mtWVnc1cDg

    Using R0J0hound 's behavior.

    behavior-isometric_t153967

    I am PRETTY suprised with how nice this behavior does the Z sort & handles the Z-moving.

    The layout is in layers, to easely build a level. On runtime it corrects for the layer offsets and brings all objects to 1 layer. Another awwsome plus for this behavior.

  • Try Construct 3

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

    Try Now Construct 3 users don't see these ads
  • 99Instances2Go Thanks. I looked at it, but I'm not using exactly 2:1 isometric and not grid based, so i can sort all kind of object sizes and shapes, in any angles.

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