Next Level Not Working

Discussion in 'How Can I...?' started by Matthew Woodhouse, Apr 22, 2020.

  1. Matthew Woodhouse

    Matthew Woodhouse Boxer

    Joined:
    Apr 19, 2020
    Messages:
    8
    Likes Received:
    3
    Hi all,

    I am new to buildbox and using the free version, I am trying to use the scenes as levels in aligned order. When the player collides with my "finish line" the next level UI will load but when tapped to go to next level/scene it just goes back to Start scene and coins collected resets to zero when they shouldn't.

    I have searched and searched but as U2 say "I still haven't found what I'm looking for" !!

    Any ideas???
     
    yassin likes this.
  2. Matthew Woodhouse

    Matthew Woodhouse Boxer

    Joined:
    Apr 19, 2020
    Messages:
    8
    Likes Received:
    3
    Sorted the first part!
    For anyone else having the same issue, I was using the Start scene as Level 1! So start scene will be the Start of each level, if scenes in order start - level 1 - start - level 2 etc.

    Still haven't figured out the coins!
     
    yassin likes this.
  3. Vlad-NY

    Vlad-NY Serious Boxer

    Joined:
    Jul 21, 2018
    Messages:
    608
    Likes Received:
    361
    Use global coins not session coins or save variable to Settings class to keep track of them. And make sure you do not reset or set them to 0 on init or start functions. (methods)
     
  4. Matthew Woodhouse

    Matthew Woodhouse Boxer

    Joined:
    Apr 19, 2020
    Messages:
    8
    Likes Received:
    3
    Thanks for the reply Vlad, global coins still not working, how would I use the save variable??
     
    yassin likes this.
  5. yassin

    yassin Boxer

    Joined:
    Apr 21, 2020
    Messages:
    2
    Likes Received:
    0
    hi all
    me too im trying many time to get next level
     
  6. Vlad-NY

    Vlad-NY Serious Boxer

    Joined:
    Jul 21, 2018
    Messages:
    608
    Likes Received:
    361
    It seems that you are using restart to increment / move to your next level. Send your code via a signal and use Variable Save/Load nodes to achieve what you need.
     
  7. yassin

    yassin Boxer

    Joined:
    Apr 21, 2020
    Messages:
    2
    Likes Received:
    0
    Thank you for reply
    I don’t understand how i can do it
     
  8. Vlad-NY

    Vlad-NY Serious Boxer

    Joined:
    Jul 21, 2018
    Messages:
    608
    Likes Received:
    361
    if possible please attach your bbdoc file and I will have a look at it.

    ps: add a build version as well
     
  9. Matthew Woodhouse

    Matthew Woodhouse Boxer

    Joined:
    Apr 19, 2020
    Messages:
    8
    Likes Received:
    3
  10. Vlad-NY

    Vlad-NY Serious Boxer

    Joined:
    Jul 21, 2018
    Messages:
    608
    Likes Received:
    361
    Hey there, thanks for the bbdoc... I fixed your issue and you can download the new version from here https://easyupload.io/dr2low

    Here are the changes and new "restrictions" / "things that you need to know":
    - I've edited the "Finish line" object by adding an If collide, a logger(that can be deleted) and a variable Save node. The Variable Save is where the magic happens/coins are stored in settings class and should not be altered if you do not know what's there
    - The Player class has a new Variable load node and a logger (that can be deleted). IN Variable Load I set the "Coins Font" to the value of the saved coins from Settings class.
    - I've changed the coins text/label to "Coins Font" and I've set it as default since we want to change the values via script.
    - I also changed the level a little bit so I could test the fix :D

    Things that you should keep in mind. The Variable Set/Load are the ones that are doing the magic and you should not change Variable Name or Storage type for the moment. If you want to change the variable name please be aware that the hole system will create a new variable and the old one will be stored on device until the data is cleared. (the results can be seen by testing on a real phone)
    On UI screen the Coins font should remain as is but if you want to rename it please modify the script of the Variable Load node in order to be consistent.(do not create multiple labels with the same name in UI)

    Side note: I know this is not the "best" solution to do this but I chose this path so you could add additional logic to the above nodes and create a save manager based on different type of triggers.


    have fun and be creative!
     
    Matthew Woodhouse likes this.
  11. Matthew Woodhouse

    Matthew Woodhouse Boxer

    Joined:
    Apr 19, 2020
    Messages:
    8
    Likes Received:
    3
    Thanks Vlad your a Star!!
     
  12. Vlad-NY

    Vlad-NY Serious Boxer

    Joined:
    Jul 21, 2018
    Messages:
    608
    Likes Received:
    361
    You're welcome! :)
     

Share This Page