P3 - Globaldepth Setter Is Not Working On Entity Nor Component Level

Discussion in 'Technical Discussion' started by Vlad-NY, Jan 28, 2020.

  1. Vlad-NY

    Vlad-NY Serious Boxer

    Joined:
    Jul 21, 2018
    Messages:
    604
    Likes Received:
    360
    Build: Buildbox_3.1.3-3446.exe
    Branch: release
    Device/OS: Windows 10 pro 64-bit (10.0, build 17763)
    Frequency: 100%

    Steps to reproduce:

    • Launch the Buildbox app and open Leap template
    • While in 3D World map double click on cube asset to open Node Map workspace.
    • From the left panel / Advanced tab drag and drop a Script Node.
    • Double click on Script Node to open the JavaScript panel[​IMG]
    • Add the following code to init or start methods
    Code:
    function init(){
        log(this.entity().globalDepth());
        this.entity().setGlobalDepth(11);
        log(this.entity().globalDepth());
    }
    
    function start(){
        let ent = this.entity();
        log(ent.globalDepth());
        ent.setGlobalDepth(22);
        log(ent.globalDepth());
    }
    
    • Start the game and press on play button
    • Observe
    Actual results:
    The console prints a constant value of 0 even thou I used to set the Global Depth value to 10 or 22.

    Expected results:
    If the user set a value to GlobalDepth to a entity or a component this should be applied and the log should reflect that change

    Notes:
    The API reference does not include the use of this method but based on my findings the setter accepts an integer value and the it returns a string value.
    This might be useful to pass some values in between UI screens and Scenes since the we do not have a way to read the Label text value just to set it (setText(value))

    Video:


    Feel free to ask questions if something is unclear.
     

    Attached Files:

  2. AlanMcLean

    AlanMcLean Boxer

    Joined:
    Jul 18, 2020
    Messages:
    9
    Likes Received:
    1
    You have an interesting game, although in my opinion someone has already made such a game. Sorry I'm new to this site and there's still a lot I don't know. What advice would you give to a newbie like me?
     
  3. Vlad-NY

    Vlad-NY Serious Boxer

    Joined:
    Jul 21, 2018
    Messages:
    604
    Likes Received:
    360

Share This Page