In this chapter, we’ll be implementing a bare-bones system to allow us to “kill” our player (don’t worry, it’s very nonviolent) and send them back to the spawn point.
We’ll set the spawn point when the game first starts, so that wherever we place the player in the scene, that’s where they’ll respawn. We won’t be doing anything flashy for now. When the player dies, their model will disappear, and the Player script will be disabled to keep it from updating. After a few seconds of wait (to punish them for failing), we’ll move them back to the spawn point and enable them again. ...