How do you create a respawn system where the player retains their items (variables?)

I am working on an assignment where I have to construct a ‘walking simulator’ game, and I intend on adding a respawn system that will execute if the player gets too close to the campfires, but after they die still keep their items they have gained before that point, but this is particularly difficult. I have tried finding the relevant guide on YouTube, the Epic forums, even on this website, but none gave a straight solution that fully explains how it is done.

I did, however, notice a blueprint from someone with a similar issue, but the result from that system isn’t what I am achieving. I even messed around with one of my blueprints by combining one of them with the new variant that is supposed to ‘respawn’ the player to see if it could work, but that also didn’t work.

This is one of the meshes from my work below:

Screenshot (105)

So, does anyone here know the full solution to create a respawn system that allows players to keep all of their items when they die?

I like a full detailed explanation of the blueprint structure so I could easily get an idea of how it could be constructed.

There are several ways around this problem, but which one you use really depends on how you want it to work

  1. Don’t respawn, just move the player. Easiest solution.

  2. Respawn first, copy the variables from one player to the other, then delete the old player and possess the new one

  3. Store the player variables in the game instance, respawn, and code the player to read their current variables from the game instance. Works between different maps, but not if the player quits the game.

  4. Store the player variables in the save game. You can even turn the PC off, and restart the game later, and read the variable from the save game.

It’s up to you…

1 Like

Can you give me some recommended blueprint nodes in this case?

Sorry, I a little new to blueprints since I haven’t written scripts for a long time.

Your ideas are great, but I think it’s much better for people in my situation if you give us the recommended blueprint nodes if that is alright? Just so they don’t have to waste time figuring out the best blueprint nodes to use.

Which one do you want to go for?

Any nodes you are aware of that is sufficient for this issue,

Thanks.

1 Like

The easiest option, just move the player back to when things were ok:

But, you need to set the checkpoints of the locations, as you go.

So you are saying,

Instead of using the ‘destroy actor’ node or the killzone volume, I could just teleport the player back to checkpoint if they interacted with something they shouldn’t?
I also like to add in the ragdoll physics just as a way for players to get an reaction to when their character dies before they are teleported back, but I have done that and it didn’t go so well. Since the camera was only teleported, but not the ragdoll character even snapping the character back to its skeleton wouldn’t work either.
Alright then.

How about this?

That only respawns the player back to the beginning of the level, and resets everything.
I prefer players to see like a death animation on their character before teleporting back to the checkpoint.

Sorry. I’ll consider taking those suggestions above later, but if you have even more suggestions you want to explain, I do it if I were you.

I would recommend storing it in the Game Instance.