Checkpoint 2D
Sets the respawn point of a node with Respawn that enters the area.
component gameplay.Checkpoint2D
On this page
Try it
Choose a checkpoint by priority
The target starts inside two checkpoint areas and immediately requests a respawn. The gray checkpoint's priority 5 beats the blue checkpoint's priority 0.
Set the blue checkpoint's Priority to 10. The scene restarts and the real Respawn moves the target to the higher-priority blue checkpoint. Reset chooses gray again.
Starts the scene; open the example parameters to experiment.
Scene4 nodes
Scriptmain.aes
package demo
// Both checkpoints inspect the target in their actual areas. The script only
// requests a respawn; the component priorities select its destination.
script TriggerRespawn {
func Ready() {
node.Get<Respawn>().Trigger()
}
}
Fields
| Name | Type | Default | Description |
|---|---|---|---|
| Area | Rect | (-1, -2, 2, 4) | Rectangle in this node's space. |
| Priority | int | 0 | A checkpoint does not replace one with a higher priority. |
| Once | bool | false | Works for the first node only. |
| Spawn Point | NodeRef | none | Node whose position becomes the respawn point. Empty uses this checkpoint's position. |
Signals
Reached signal
signal Reached(by NodeRef)
Fires when a node takes this checkpoint.
Related guides
- Checkpoints A Checkpoint 2D moves the respawn point of a node with Respawn that enters it, to its own position or to the node in Spawn Point.
- Gameplay kit The gameplay module adds the parts most 2D games rebuild by hand: a character controller, hit points, hitboxes and hurtboxes, kill zones, checkpoints with respawn, pickups and timed removal.