Loosing Faith In Buildbox

Discussion in 'Buildbox 3.0' started by LtgGames, Jun 3, 2023.

  1. LtgGames

    LtgGames Avid Boxer

    Joined:
    May 4, 2020
    Messages:
    126
    Likes Received:
    32
    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.
     
    Thilonaut and hu6ygtrfcd like this.
  2. Vlad-NY

    Vlad-NY Serious Boxer

    Joined:
    Jul 21, 2018
    Messages:
    614
    Likes Received:
    362
    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
     
  3. LtgGames

    LtgGames Avid Boxer

    Joined:
    May 4, 2020
    Messages:
    126
    Likes Received:
    32
    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...
     
  4. Elite Games

    Elite Games Avid Boxer

    Joined:
    Dec 18, 2019
    Messages:
    184
    Likes Received:
    84
    upload_2023-6-17_14-2-2.png

    Try this set your character above Camera in layer order
     
  5. Vlad-NY

    Vlad-NY Serious Boxer

    Joined:
    Jul 21, 2018
    Messages:
    614
    Likes Received:
    362
    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 :)
     
  6. Vlad-NY

    Vlad-NY Serious Boxer

    Joined:
    Jul 21, 2018
    Messages:
    614
    Likes Received:
    362
    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:
    1. The animations do not have 3D Mode enabled (this does not matter that much but it's good to be consistent)
    2. 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!
     

Share This Page