Announcement

Collapse
No announcement yet.

Level restart only works once after player death

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

    Level restart only works once after player death

    Hi - I'm trying to restart the game if the player falls off the level.
    The attached blueprint works..but only works once...if you die twice it doesn't re-start.
    Any ideas ?!
    Click image for larger version

Name:	restart.jpg
Views:	1
Size:	54.2 KB
ID:	1167703

    #2
    Ehm, why don't you put the GetCurrentLevelName node between OnDestroyed and OpenLevel?
    The thing you do should probably be saved in a variable.
    Open for contracted work | C++/BP (incl. Multiplayer) | Tutoring | VR

    My UE4 Blog/Page with Tutorials and more: Hit me for ALL the things!
    (Including 100+ Pages Multiplayer Network Compendium to get you started.)

    Comment


      #3
      Thanks for the feedback

      Comment


        #4
        Originally posted by joeycampbell View Post
        Thanks for the feedback
        Did that even help? xD
        Open for contracted work | C++/BP (incl. Multiplayer) | Tutoring | VR

        My UE4 Blog/Page with Tutorials and more: Hit me for ALL the things!
        (Including 100+ Pages Multiplayer Network Compendium to get you started.)

        Comment


          #5
          Sorry I was away from my desktop earlier - just tried it and no it doesn't work unfortunately!

          Comment


            #6
            So, when the player falls down, you destroy the Actor. Then the "OnDestroyed" is called and it should restart the level, right?

            Could you place a "PrintString" node directly behind the OnDestroyed, to check if it is even called correctly on the second attempt?

            You might want to think about a solution where you just check the Overlap in your Zone that destroy the character and restart the
            game from there. In the end, it would be the same result. Just an idea, if we can't solve this very problem.
            Open for contracted work | C++/BP (incl. Multiplayer) | Tutoring | VR

            My UE4 Blog/Page with Tutorials and more: Hit me for ALL the things!
            (Including 100+ Pages Multiplayer Network Compendium to get you started.)

            Comment


              #7
              Hi - to save time I triggered destroy by the number 4 on the keyboard.
              It destroys the actor once and then refreshes the screen for a split second and restarts the level.
              I added in a print string which works the first time I press 4 but not after the level restarts....after the level restarts and I press 4 nothing happens at all.
              Could it be that the level blueprint is wiped after "open level" ?

              Comment


                #8
                Originally posted by joeycampbell View Post
                Hi - to save time I triggered destroy by the number 4 on the keyboard.
                It destroys the actor once and then refreshes the screen for a split second and restarts the level.
                I added in a print string which works the first time I press 4 but not after the level restarts....after the level restarts and I press 4 nothing happens at all.
                Could it be that the level blueprint is wiped after "open level" ?
                Hm, no. If it is the same level you load, then not. Can you actually control your character after respawning?
                Open for contracted work | C++/BP (incl. Multiplayer) | Tutoring | VR

                My UE4 Blog/Page with Tutorials and more: Hit me for ALL the things!
                (Including 100+ Pages Multiplayer Network Compendium to get you started.)

                Comment

                Working...
                X