Hello all!

Today, I will go over how to make the Player invulnerable after getting damaged! It makes the Player blink like retro games too!

Damage Behavior

Everything is in the Player script and dealing with the Damage() method.

  1. Open the Player script.
  2. Head down below the Damage() method.
  3. Make an “IEnumerator InvulnerabilityRoutine()” method:

Hello all!

Today, I will go over how to quit your game by using the Escape key! This is pretty simple but will be needed for test builds.

Code for Quitting your Game

  1. Open the GameManager script you made before, then add this if statement to the Update() method!

That was it… See pretty simple! If you hit the Escape key, quit application.

This is useful so we don’t have to have our end users struggle to close a program. I don’t want my end users mad at me!

  • Note: This feature does not work in the Unity editor, you will need to test it in a build of your game!

This was how to quit a game! Next, I will start by making my enemies fire lasers down at me!

Thank you for your time!

Marcus Cohee

Marcus Cohee

Hello all! I am starting Unity and learning the rope as I go!