Game Over User Interface

I’m conscious that we cover this content many times in the Unity 2D course, so if we went a bit quickly or things didn’t make sense, be sure to have a look at the more detailed rundown in that course on all things UI related.

I played a little with Text-Mesh:

2 Likes

Perhaps this is a problem with Unity 2019.3, but this section of the course didn’t work for me. I took forever trying to fix it, and then went on to the next section - where I had the same problem!
However, @JimmyB in the Discussion fixed this:
Creating A DeathHandler Class?

The problem I think is that the Input.GetButtonDown in Weapon.cs (using some form of OnMouseClick function) is over-riding the mouse click on the Canvas.
So even if you put a debug/print message to respond when clicked, the Weapon would shoot instead. Very puzzling. Anyways, the solution above works (and removes the weapon image, which is cool)

I created and tested the Application.Quit(); method on the “Quit” button.
For some reason I have to click the button 3 times before the game exits.
The “PlayAgain” button works fine.

BUTTONS DOWNT WORK PROBLEM SOLVE

Hello if you are using Player Capsule thing for the player you have to go settings and uncheck Cursor Locked inside the “starter assets” script. Thats how I fixed my issue because I couldnt interact with my buttons with that checked.


image

5 Likes

God bless you! Was trying to fix it for half an hour, searched the answer in the Unity forum, stackoverflow. Thank you very much!

Privacy & Terms