Display order Behavior?

I don’t know if there is already a way, but it will be nice if we can have a way to change the display order (like during the game)

6 Likes

There is no way of changing the display order within the game or by behaviors (that I know of). You can only change it within the editor.

3 Likes

I agree, it’d be pretty handy

3 Likes

There have been many times I wanted to have it as a behavior. Hopefully someday, lol.

3 Likes

This has been requested enough that it’s definitely going to happen. The main reason it hasn’t happened yet is that the engine will need to be updated so that every object can have it’s own order value (instead of every object type)

11 Likes

If it’s that big of a change it could be the main focus of the next major update

3 Likes

One simple workaround already exists for this, and that’s to use spawn/attach order instead of display order. Objects that are newly spawned or attached are placed on a higher layer than objects of the same type that are already in the game.
You can set every object type to the same layer, then spawn them in the order you need them to be (furthest back–>farthest front). So if you need something to “change” layers, you can delete the object and then respawn/reattach it and it will appear above other objects. This unfortunately does mean that you can only “move” objects from back to front, and not vice versa.
However, you can get more complicated with it, and use the normal object layer property, but then use the spawn/attach order to get “sub-layers” within objects that are close in layer to each other.
I can provide a game example if that explanation doesn’t make sense.
But yes, of course it would just be so much nicer to have a layer behavior that lets you change an object’s layer mid-game.

2 Likes

Do you have any exemple, like a game that use this

2 Likes

I did something similar in this example:

When the car goes on top of the bridge it adds another car on top that makes it appear on top of the bridge, when it really just drives underneath.
Then takes it off when it enters the underside of the bridge.

6 Likes

Thx a lot, that will sure help me

4 Likes

The problem with this is that you have to do this with all objects and have attachments for ever layer you need. The atom example in my newer orbit system uses attachments. It’s incredibly inconvenient.

2 Likes

Yep, that’s why I really hope we get layer control soon, it takes forever as it is now

Thx Grazer for adding the behaviour, it will surely help me :grin:

2 Likes