Respawn with advanced level

I would like to know if there is a way that when I die, I revive but with the advanced level, that is, if I destroyed things, they no longer appear. Thank you

this is the blueprints of the characters to die

If you want to reload a level and have things as they were after you last left it, you need to look at the save game

1 Like

thanks for the info. I will see it

The tutorial is good, but it’s not what I’m really looking for. my idea is to save automatically without a menu. How to have infinite lives

If you want to save, you need to use the save game. That’s it, I’m afraid.

You don’t need a menu. It can be automatic.

ok, I’m going to try it. Thank you :smiley:

1 Like

I’m not sure what you’re saving though :slight_smile:

If the player dies, and a new level opens, what is being saved?

at the same level, to automatically save progress. if for example I destroy seeds and an enemy hits me and I die, I revive at the same starting point but with the seeds that I destroyed previously they do not appear

Yes, then you need the SG.

It will work with the game instance up to a point, but that doesn’t survive a restart.

As discussed before. This does not require saving at all. Reset the player. Do not restart the level. Unless you really must reload the entire level for some other reason that was not mentioned yet, ofc.

Or that…

what nodes should i do to restart the player and not the level?

If you destroyed the player, you could spawn it from class. Or look into how Game Mode works - it can handle resets and default spawning.

image

You’d absolutely need saving if you travelled between levels and wished to return and continue previous adventure. Or quit game mid-level and load a save game.

It’s good practice to learn it anyway, so perhaps it is the better solution here.


And lastly - do note there may be no need to even Destroy the player if you want to continue. Why waste time and effort for that. Move the player to the original start point when they die instead…

I put this in game mode

so I have in the blueprints of my character

Sorry, that’s not how any of this works. Please do look at some basic tutorials. It will save you a lot of time :expressionless:


If you insist on destroying the player, you can restart it like so:

image

You must hook it up to your own script. The above assumes you are using a Player Start - if you do not, please look it up. Almost all templates that come with the engine use it.

cool! we got that part! Seeds no longer appear on restart

but how do I make my enemies also appear at the checkpoint?

How did you make them appear in the first place? Also, what is the “checkpoint” here? I am assuming you want to reposition the remaining enemies; as in - place them where they originally started?

when enemies kill me, they don’t spawn at their starting point, they spawn where they killed me

video cap

here in the blueprints of the enemy

captura2

here in the blueprints of my character

this is where they start

And you want them to go back there, right? Many ways to do it, you could reset them like the player if you associated start points with them. Ideally.


But the most simple method would be to move them there. Ensure each enemy knows its starting point when the game begins, create a new variable:

image

You can then call this Reset Position custom event after Getting All Actors of Class after the player has been moved to their starting point.


That’s why it would pay off if you actually watched some tuts on the game mode and re-spawning. Those behaviors can be automated. So when you create more levels, things just work and you do not need to script the same stuff every the time.

cool!!! we are close. the only thing missing is for the enemies to move again