AppleyAppley Docs
Docs/API Reference

Checkpoints

Implement respawn checkpoints and progression tracking.

25 min read Intermediate Updated 2026-07-01 v2.0 ~87 min to complete

Introduction

Checkpoints let players retry difficult sections without restarting. This guide covers checkpoint placement, activation, respawn logic, and cloud persistence.

Guide 14 of 25

This is part of the Intermediate Guides collection. Category: Gameplay Systems. Estimated completion: 87 minutes. Difficulty: Intermediate.

Screenshot

Checkpoints
Checkpoints

Step-by-Step Guide

1

Create checkpoint objects

Place checkpoint triggers at key locations. Use invisible trigger volumes or visible flags.

2

Track active checkpoint

Store the current checkpoint ID. When a new one triggers, update the active and deactivate previous.

3

Implement respawn

On player death, wait 2-3 seconds, then respawn at the active checkpoint with full health.

4

Add visual feedback

When activated, show flag-raising animation, particle effect, UI notification, and play a sound.

5

Persist to cloud

Save the active checkpoint so players resume from their last checkpoint after closing the game.

6

Handle level restart

If the player restarts manually, reset to the first checkpoint or the cloud-saved one.

FluxScript Example

Here is a complete FluxScript implementation for this guide:

Checkpoints — FluxScript
activeCheckpoint = null

on start {
  checkpoints = world.findAll("checkpoint")
  for i = 0 to checkpoints.length {
    checkpoints[i].activated = false
    checkpoints[i].setMaterial("flag_red")
  }
  saved = save.get("activeCheckpoint")
  if saved != null {
    for i = 0 to checkpoints.length {
      if checkpoints[i].id == saved activateCheckpoint(checkpoints[i])
    }
  }
}

func activateCheckpoint(cp) {
  if activeCheckpoint != null {
    activeCheckpoint.setMaterial("flag_red")
    activeCheckpoint.activated = false
  }
  activeCheckpoint = cp
  cp.activated = true
  cp.setMaterial("flag_green")
  cp.playAnimation("raise")
  effects.spawn("checkpoint_effect", cp.position)
  audio.play("checkpoint")
  ui.toast("Checkpoint reached!")
  save.set("activeCheckpoint", cp.id)
  save.flush()
}

on triggerEnter(other) {
  if other.type == "player" && !self.activated {
    activateCheckpoint(self)
  }
}

on event("playerDied") {
  ui.show("deathScreen")
  timer.start("respawn", 3.0, 1)
}

on timer("respawn") {
  player = scene.find("Player")
  if activeCheckpoint != null {
    player.setPosition(activeCheckpoint.position + vec3(0, 1, 0))
    player.setHealth(player.maxHealth)
    player.setVelocity(vec3(0, 0, 0))
  } else {
    scene.reload()
  }
  ui.hide("deathScreen")
  gameRunning = true
}

Node Graph Example

Prefer visual programming? Here is the equivalent Node Graph:

Checkpoints — Node Graph
[On Start] --> [Find All: checkpoints] --> [Set: red flags]
   --> [Load: saved checkpoint] --> [Activate if found]

[On Trigger Enter] --> [Branch: player + !activated]
   --> [Activate: green flag, animation, effect, sound]
   --> [Save to Cloud]

[On Event "playerDied"] --> [Show: deathScreen] --> [Timer: respawn 3s]

[On Timer "respawn"] --> [Branch: activeCheckpoint]
   +-- True --> [Set Position + Health + Velocity]
   +-- False --> [Scene Reload]

Optimization Tips

Keep your implementation fast and efficient with these optimization tips:

  • Save checkpoints to cloud storage. Players expect to resume from their last checkpoint after closing the game.
  • Validate checkpoint position before respawning. If the area has changed, adjust the respawn position.
  • Give players 2-3s invulnerability after respawning. Prevents instant re-death from nearby enemies.
  • Use trigger volumes for checkpoints, not collision. Triggers detect without blocking movement.

Common Mistakes

Checkpoint too close to a hazard

Place checkpoints in safe areas. Respawning next to the hazard is frustrating.

No visual feedback on activation

Players need to know a checkpoint activated. Show visual change and play a sound.