Adding respawn checkpoints to a 2D game
2D Game Design with Unity
🕑 This lesson will take about 7 minutes
In this lesson, you will learn how to add checkpoints to a 2D game in Unity. These checkpoints will be used to save a player’s progress and update the player’s respawn point. Implementing this involves two steps:
Add checkpoints throughout a scene (using tagged empty GameObjects)
Write C# code that checks for player collision with checkpoint colliders and updates the respawn point
The code to implement the respawn checkpoints will be added to an existing script we have worked on throughout this course called ‘PlayerController.cs’ (scroll down for the sample code).
Game art, tiles and sprites from the Free Pixel Space Platform pack are used in this lesson video and can be downloaded from the Unity Asset Store.
Is YouTube blocked at school? Watch on Google Drive.
Sample code
Next lesson: Level management and teleporting between scenes