Checkpoint system in platformer

Hi,

I would like to ask how to create a checkpoint system similar to Crash Bandicoot.
More specifically I would like to mimic this sitiuation:

  1. Player activates checpoint making new respawn point.
  2. Player goes futher in the level, collects items etc., but he loses a life before he reaches next checkpoint.
  3. All items that were collected after checkpoint activation are lost and respawned in the level(in Crash examle those would be crates, enemies and woompa fruits).

I drag&drop my items on the scene as prefabs. Simply put I would like to save a state of my scene and revert to it after death. Any suggestions? :slight_smile:

There are many ways to handle this situation, you could have an array of transforms called “CheckpointsList” of your checkpoints. Then create an int named "Checkpoint"of which checkpoint your character will respawn at. And when he collides with your checkpoint plane change the “Checkpoint” int to its value plus one. So when he dies you can destroy the current player, and instantiate him at item “Checkpoint” of “CheckpointsList”. To retain all items he had when he touched the Checkpoint platform, I would create another array and add a list of objects he had named “ObjectsInInventory”. and when he touches a new platform, make sure to delete all the contents of “ObjectsInInventory” so there are no duplicates of objects he had already. Hope this helped if you need any scripting references comment. (: