Menu
CoddyTech

Reach a Checkpoint

Part of the Building Real Games section of Coddy's Unity journey. Lesson 53 of 60.

challenge icon

Challenge

Medium

Make the red poles move the respawn point.

  1. In Checkpoint, write OnTriggerEnter: when the object has a Player, call its SetCheckpoint(transform.position).
  2. Then turn the pole Color.green and log Checkpoint reached.
  3. Keep a bool reached so this happens only the first time.

Press Play, touch a pole and fall: you come back at the pole. Then Check.

Try it yourself

using UnityEngine;

public class Checkpoint : MonoBehaviour
{
    // A later lesson fills this in: a flag that moves where you come back after a fall.
}

All lessons in Building Real Games

Practice on your own: Unity playground