Announcement

Collapse
No announcement yet.

Move to Next Level Based on Score

Collapse
X
 
  • Filter
  • Time
  • Show
Clear All
new posts

    Move to Next Level Based on Score

    Hello! Have a score widget setup that gets hit data from the projectile and feeds it onto the screen. Would like to open a new level when player reaches a certain score .

    What would be the best way to set this up. Really not for sure how to even start. Maybe cast to Score Widget to get the score and then place a branch if true open next level?


    Maybe something like this:

    1) CustomEvent > CastToScoreWidget > GetScore > ???Formula??? If higher that 5,000 then open level?


    Any help would be apperciated

    Thank you,
    John

    #2
    Typically you don't do this in a Widget. The Widget is just visualizing the score through binding.

    You should rather find out where the score is updated and add your level change logic there. Probably this happens in the Hit event for the projectile. After the score has been updated, you can check with a Branch if it is > 5000 and, if it is, call Open Level with the next level to be played.
    CTO | Head of VR Development - Visit us at http://humanxr.com
    My UE4 Tutorials (mostly VR): https://goo.gl/GUvDyV

    Comment


      #3
      Looks good. Happy it worked. Good job!

      Performance hits when using Event Tick are not an issue as long as you limit the amount of code you run at each frame and keep it efficient. In your case I would say it is perfectly ok.
      CTO | Head of VR Development - Visit us at http://humanxr.com
      My UE4 Tutorials (mostly VR): https://goo.gl/GUvDyV

      Comment


        #4
        Thank you vr_marco for your reply and helping me ! I did what you said and it worked! I ended up moving the logic to the level BP because the goal to each level may be different.

        I had to use an "Event Tick" to get it to work, I have heard that you can take a performance hit by using those, what do you think?

        PS: Here is a screenshot of the code:

        Comment


          #5
          Click image for larger version

Name:	
Views:	0
Size:	169.9 KB
ID:	1391467

          Comment

          Working...
          X