Player Respawn Help?

Hey all,so i want to make a Blueprint where since my current prototype project is mostly jumping across platforms.It has nothing under it so i basically want to make it so if they fall off or miss the platform and fall they basically “Die” and respawn at the beginning/checkpoint thanks in advance

The way I achieve this is by re opening the current level. About the checkpoints there is several ways to do so but if it is a platformer I assume that just spawning the player at the right position is enough, am I right?

If that is the case, the easiest way to achieve this is by using a new Actor, let’s name it “CheckPoint_BP”. We will also need to override the GameMode and the GameInstance.

Since the gamemode is launched at each load of a level, this blueprint will be used to get the position where the player must spawn. The gameinstance is never reset while in play (even if the level is re opened), in here the fact that the player must load a save will be stored (with a bool).

The checkpointBP will write the player’s transform in a save file when the player triggers a specific collider (I advise using a squared distance).

More informations :

There are many ways to go about doing this. I’ll show you a super simple blueprint I made that will instantly set your location to the “respawn point” you specify. However it will not reload or reset anything else, which might be preferred, depending on the type of game you want to make. But you could always manually reset other things you need by adding on to this code. (You can add this code to your player movement blueprint.) (I see you’re a pretty new member, so I’ll try and be very detailed.)

On the “Event tick” we check to see if the player (a ball in my case) is below a certain height (-2000). IMPORTANT: in order for this to work, we need to make sure the “world kill z” doesn’t vanish the player before (or at the same time) this happens. Navigate to the worlds settings tab (it should be in the view port) and either set the kill z to something a good distance lower, or uncheck “Enable World Bounds Checks” to remove the kill z entirely.

(Now back to the blueprint:) Next, we set the players world location to a variable I named “respawn point”, which “Event BeginPlay” set to the original starting point. To set up check points in your level, you must change the value of “respawn point” any way you want. For example: You could have check points being an item you collect or a sensor you cross over, and then set “respawn point” to the world location of the check point. This would be done with an “Event Actor Begin Overlap”. (In case you’re new to overlaps: Navigate to the details panel for both actors involved with the overlap and make sure Collision response between the actors allow Overlaps, and Generate Overlap Events is set to true. Otherwise nothing will happen.)

Also, it might be a really good idea to exec a “Stop Movement Immediately” node after resetting the players location.
Don’t worry about how “cheap” the respawn looks. You could add some death and/or respawn animations and add a scene transition effect (such as fading in and out) to make it look good.

I hope this helps you. Let me know if you need more info on this topic. : )

Thanks, i’ll be sure to try that :slight_smile:

Thanks for the help,it was detailed and easy to follow :slight_smile: