Check out the new @mentions and Tagging Feature!
We're testing a feature out on the forums, user @mentions (Twitter style). You can also tag users on a post/thread at the top of each page.Please have a play and PM Simon or post here if you experience any issues.

Order of objects/layer object

Hi all, I have pretty much completed a game I have been working yet I cannot show it to anyone as the order of the objects (in front, behind, etc) is completely off. What is the easiest and most effective way to create a order hierarchy with many objects, most with multiple instances. I have been trying for weeks with no luck, i have tried the layer object and that didn't help either. I have tried the normal order but the reference has to exist (sometimes there is no instance of an object).

Thanks so much, this is pretty urgent so id appreciate any help I can get

As a general rule, objects created at runtime are always "on top" in their respective layer. The Layer object is good to force specific ordering either by moving objects to a specific z position (1 being the back-most (0 is not used, ordering is 1-based)) or by sorting all objects in a layer based on y position. I find it helpful to keep an alterable value reserved for "z position" and sort by alterable value with the layer object. If that still has issues, then keep some specific "ObjA Overlaps ObjB" -> Move ObjA in front of ObjB events. I have yet to find a super simple way to keep large groups of objects from accidentally sorting in odd ways 100% of the time without being more heavy handed and separating them to their own layers (ie characters, ui and backgrounds on their own layers)

Hum thanks. The overlap method could work but I think it would be very CPU intensive. As for the alterable value layer method that could also work but I fear I have used alterable z values. Order.jpg Whats wrong with this method? Is it because I need to run a loop for each group of objects? Thanks so much.

If you're using qualifiers then if it doesn't exist Fusion will just ignore the command and carry on.

Changing the order at the create event of any object and using it with "always set the order" has worked correctly for me.

If what you're doing is more complex than I'm imagining, it might not be the order that's the issue, but how and when you're creating the objects - then you could look at changing the order of your creation events instead.

Ok thanks, i have a huge always event which sends objects/qualifiers first to the front then behind certain objects. This works much better than previous attempts, but still has some errors. I just need to add order events after creation for immediate effect. For some reason two objects alternate order. For example object a will have the correct order in reference to object b and then another object a will have the wrong order in reference to object b.

I believe when you simply tell a qualifier group to move above/below another object or qualifier, it just singles out one (possibly the last one created?) and leaves the rest where they are. This can be resolved with a foreach loop or careful management of sorting when you create an object. It is hard to understand your intentions with that simplified example. The last thing you want to do is sort every frame as it will cause a lot of unnecessary cpu use.

As for overlapping conditions, they are not that expensive if you are careful in how you use them.