UnityRoad TO Dev — Game Over! Let’s tell the player.

Ok so now we have the basics down for making and using the UI let’s create a game over screen for our player and give it a retro flashing feel akin to the old arcade days.

First we will need to create the game over text UI element and here we can alter the text size and screen placement. I’d suggest anchoring it.

Now that we have the element we can create it’s flashing feature. There are a number of ways to do this but I feel just setting it active and inactive is the best. Of course we need to start it as Inactive.

Now just like before we need to create a handle for our UIManager to know what this element is. Remember to attach the element to the UIManager after creating the handle.

We can create the default state as well.

Now let’s create our method and flicker routine.

Once we have this set we can just have our player tell the UI when it’s dead indicating game over. Make sure to do it before you kill the player object of course!

Now if everything is setup correctly we should get a flashing game over screen once our player dies!

--

--

Get the Medium app

A button that says 'Download on the App Store', and if clicked it will lead you to the iOS App store
A button that says 'Get it on, Google Play', and if clicked it will lead you to the Google Play store
Rob Smith

Hi there! I am currently on the path to learn how to become a unity developer and will be documenting my journey as best as I can here. Thanks for looking!