Lives and Respawns
Objective: Creating the lives and respawn system for my 2.5D game.
To get things going, the first thing I did was create the UI to represent our lives, as well as hooking up that UI to my UIManager.
I call these methods through my PlayerController script as needed. With this hooked up, I then created an empty GameObject and named it RespawnPoint. This will serve as the position our player respawns at when they fall off the platforms. With that, I created another empty GameObject and gave it a BoxCollider with IsTrigger set to true. This GameObject was named DeadZone and I set it up below all of the platforms.
On this object, I also attached a custom C# script with an identical name. I used the following code to implement everything.
With all of this working together, I get the following result:
That’s all for today! Thanks for reading!