P0 - App Crash When The Priority Value Is Set To 0 On Enabletouch Method

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

  1. Vlad-NY

    Vlad-NY Serious Boxer

    Joined:
    Jul 21, 2018
    Messages:
    605
    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 duplicate the character and change its color in order to distinguish the 2 characters.
    • Add the 2nd character to the scene just behind the yellow one. (if you start the game you can see that both characters react to mouse movement)
    [​IMG]
    • Now tap on both characters to open the Node Map.
    • Tap on Touch Move Ph node to open the JavaScript panel.
    • Change the line 10 from this.enableTouch(); to :
    Code:
    //The first character has the following code:
    this.enableTouch(true, -1);
    
    //The second character has the following code:
    this.enableTouch(true, 0);
    
    • Save the code
    • Start the game and press on play button
    • Observe
    Actual results:
    After you tap on play button the app closes generating a crash report.

    Expected results:
    Based on documentation the 1st character should be movable and the second character should not receive any touch event.

    Documentation:
    enableTouch(swallow, priority)

    Enables touch events. Component will start receiving events for three functions [
    touchBegan(point), touchMove(point), touchEnded() ]

    Code:
    swallow
    (optional) is set to true, then entities with lower priority will not receive their touch events.
    
    priority
    (optional) can be negative or positive. Based on priority engine will device who receive touch event first
    Notes:
    This happens only when at least one entity has priority set to zero.

    Video:


    Feel free to ask questions if something is unclear.
     

    Attached Files:

Share This Page