Display the game over screen after the character dies How can I respawn when the enter key is pressed?

ymo

Member
Display the game over screen after the character dies
How can I respawn when the enter key is pressed?
 
Here is how i would do it: First of all, disable in the CharacterRespawner script "Schedule Respawn On Death".

Then setup a listener to capture the "OnDeath" event of the character in a custom script.

When the event is triggered, display the "Game Over" and start listening for keys pressed. When the user press the key you want, schedule the respawn manually.
 
Last edited:
I didn't write any scripts to wait for interaction and then respawn character:
1. Create button under canvas and disable it.
2. Set button event OnClick() > Character > CharacterRespawn.Respawn54cdf45f2dfaeca597ea250be0bed27.png
3. Set CharacterHealth event > OnDeathEvent()> Gameover(Button) > GameObject.SetActive > True
5727201b636429428b97961f490f464.png
4. Set CharacterRespawner event > OnRespawnEvent()> Gameover(Button) > GameObject.SetActive > False
6b5c6d3cddaebdcc9a21a354ed974c4.png

This is my test. Please give me more suggestions.
 
  • Like
Reactions: ymo
Top