I want to make checkpoint system. When player dies, I use “Restart Game” to restart level (it’s important for me to use it since i want to reset everything in level - enemies, collectibles, etc.) There are also several player starts - checkpoints - in level which player activates by going through them.
The question is, how do I keep track of what player start to use after resetting the level?
Tried to search for information, but people usually just respawn player and that is not an option…
It would be better to create a save system overall.
But when it comes to player start, all of them has a ‘player tag’ usually empty. You can fill that tag with whatever you want (name, numbers, for example ‘checkpoint01’) and you can call using ‘FindPlayerStart’ (fill the ‘incoming name’ with the tag you previously set) and the return value you can set at ‘Restart Player at Player Start’. You can do this inside your game mode.
However, I don’t think that will fix your problem enterily. I think you need to set a save system to keep track of the players checkpoint properly. You can use what I said above, but it would work better with player system. You could save a integer inside you data table and using the return value you could convert to string and use on ‘FindPlayerStart’ (but the ‘incoming name’ set on PlayerStart should be numbers as well).
For example, I’m using this for my multiplayer game. On lobby, I want the host player to be at the center, so I use these to select which player start will be filled first.
In my head, this could work perfectly. But in case you need more assistance and don’t know exactly how to set this, I’d recommend watching a tutorial series of Save Game.
Ryan Laley channel has some awesome content. I’ve learned many things from him. Matt Aspland too! You don’t need to do exactly like them, but you’ll learn from them the base and you can implement with whatever you want.
Give each checkpoint a unique tag / name.
Put a trigger box around each checkpoint, such that when the player enters that box, a trigger function runs that updates a “last seen checkpoint” property on the GameMode or maybe even PlayerController. (depends on networking or not, and such.)
When the player dies, play the death animation, then reset hitpoints or whatever, set the player back to regular animation, and place the player at the player start object that has the name that’s stored in the property.
Yeah, I think I might try using save game (or maybe game instance, we’ll see). Thanks for info about player starts!
I also found this way to be interesting, this person actually uses Save Game so I’ll definitely try it
I’ll check out Ryan Laley too, also recommend
Mathew Wadstein channel - awesome info videos