As you are switching levels, you do need some form of persistence (saving) in place. The reason for this is because GameModes are reset when the level changes and like you mentioned, the Checkpoints don’t exist.
If you want the player’s progress to be reset when the game is closed, this will be very easy. Otherwise, it will require quite a bit more code.
Checkpoints reset on game closed
- Make a new GameInstance BP. (GameInstances never change when playing the game).
- Give it a Transform variable called Spawn Transform.
- Go to your project settings and change your GameInstance to the newly created one.
- In the GameMode BP, override Find Player Start function (or something similar), and return the Spawn Transform found in Game Instance (you will need to cast your Game Instance).
- Whenever a Checkpoint is triggered, update the Spawn Transform variable in the Game Instance.
Checkpoints not reset when the game is closed
Many ways to do this but a basic way can be using a SaveGame:
- Create a new SaveGame BP and add SpawnTransform as a variable.
- Override your Game Mode’s Find Player Start and try to load this newly created SaveGame file. If found, use its SpawnTransform, otherwise normal player start.
- When a Checkpoint is reached, save the new spawn transform to the SaveGame BP.