I´m trying to make a 2d game with Buildbox 3. But there are so many challenges. When spawning assets from existing assets... the spawned object then lays in the front... (in front of the character). I need the object just to replace the old object .. same location - behind the character. Lately, I have tried to reach out to the community but there is no help. And Buildbox just spamming me with ads and promotions. I miss the days with Zack Griset and his tutorials and interaction with the community. My first love with Buildbox is over. It's fading away.
What do you need yo do with the spawns? The hierarchy of the objects spawns the latest on top of everything else what you need to play with is global depth to order things around în your case
Thanks @Vlad-NY for reaching out! The object is a door animation that will spawn an open-door animation. But the assets put themselves in front of the character. The global depth didn´t work... so I switched to 3d in buildbox and made it work.. but when using 3d you lose some of the 2d-retro-feel...
For 2d you need yo enable 3d mode and use depth order to make sure you git this result buut if you spawn new scenes it will always be on top of the current ones, my advice is to use some layers objects and add enemies, background, I player and ui on those specific objects of each scene Plus a pooling system or object visibility system could do a lot of improvements Try the 3d mode first maybe that would help if not I'm gonna think of a new way
OK so I've been playing around with the Animations so that I could help you for the 2D world setup and here's what I found: For 2D you need to make sure that: The animations do not have 3D Mode enabled (this does not matter that much but it's good to be consistent) Properly set the Depth to the based on what you required I've tested with objects that had: The background had Depth set to 0 using the API, not the "Depth Order" option (that does not work) The player had Depth set to 1 to go behind the objects or -1 to get in front of the objects The code Tthat I used is this: Code: let filter; function init(){ filter = 't'==this.attribute('Pass only'); } function signal(name, value) { if(value == filter) { this.entity().setGlobalDepth(this.attribute('Global Depth')); this.emitSignal('Out', value) } } I add it inside a Signal Filter node with In being enabled and I also Added a Number attribute called "Global Depth" and pinned it so I can change it based on my needs So my suggestion is to organize your project a little or just add the above script to the player to make it in front of all the objects. If you still have issues find me on Discord and we can chat there Have fun!