Distance Score For Bb3?

Discussion in 'How Can I...?' started by Polat, Jan 14, 2019.

  1. Polat

    Polat Boxer

    Joined:
    Jan 10, 2019
    Messages:
    7
    Likes Received:
    0
    Hey, does anyone know how to add a distance score counter to BB3?
     
  2. weboha

    weboha Avid Boxer

    Joined:
    Aug 8, 2018
    Messages:
    237
    Likes Received:
    174
    try this:
    let dist = this.scene().path().pathPosition();
    log(Math.round(dist));
     
  3. Polat

    Polat Boxer

    Joined:
    Jan 10, 2019
    Messages:
    7
    Likes Received:
    0
    Hello, thanks but I'm not really good with coding. Exactly where should I paste this code?
     
  4. Christianj40

    Christianj40 Boxer

    Joined:
    Oct 12, 2018
    Messages:
    2
    Likes Received:
    1
    Have you figured out where to place the code? I also would like to have a label display the distance?
     
  5. itzonator

    itzonator Serious Boxer

    Joined:
    Dec 18, 2017
    Messages:
    570
    Likes Received:
    220
    This does not work.
     
  6. weboha

    weboha Avid Boxer

    Joined:
    Aug 8, 2018
    Messages:
    237
    Likes Received:
    174
    i tried now, its works.
     

    Attached Files:

    itzonator likes this.
  7. itzonator

    itzonator Serious Boxer

    Joined:
    Dec 18, 2017
    Messages:
    570
    Likes Received:
    220
    Can you show me the node you used for this and where it's linked?
     
  8. weboha

    weboha Avid Boxer

    Joined:
    Aug 8, 2018
    Messages:
    237
    Likes Received:
    174
  9. itzonator

    itzonator Serious Boxer

    Joined:
    Dec 18, 2017
    Messages:
    570
    Likes Received:
    220
    Thanks Weboha, yes this works, but it's causing game performance issues. It lags as hell due to my game features. My game has constant moving character and this label is moving with it. This label drag and calculation is causing game performance problems.

    I was looking for something simple like UI (Distance Score) like we had with BB2. Any ideas on how to make this node smother / lighter to avoid the performance issues? Maybe not to calculate the distance that much (example to calculate with one or two integers, instead of 4 integers.
     
  10. itzonator

    itzonator Serious Boxer

    Joined:
    Dec 18, 2017
    Messages:
    570
    Likes Received:
    220
    I removed this line:
    Code:
    log(Math.round(dist));
    
    Game performs better.
     
  11. itzonator

    itzonator Serious Boxer

    Joined:
    Dec 18, 2017
    Messages:
    570
    Likes Received:
    220
    Now idea how to display this score on Game Over screen?

    Since bbAssets can be added on UI, we can build a custom script with this Display Score and have that as a separate object in the 3D world. Then we can export this custom Display_Score_bbAsset and Import it to the Game Over UI.

    What would be the code for that to Display CURRENT / BEST scores for CURRENT world? :) :p

    @PunkPuffin - you know?
     
    Last edited: Apr 22, 2019

Share This Page