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.
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.
God bless you! Was trying to fix it for half an hour, searched the answer in the Unity forum, stackoverflow. Thank you very much!
“I just wanted to share my thoughts on Casino Royale (1986). It’s a classic for sure, but if you’re looking for something a bit more interactive and modern, I highly recommend checking out the Megapari Aviator app. I’ve been using it for a while now, and it’s been a great addition to my online gaming experience. The app is really user-friendly, and the gameplay is top-notch. Download Megapari aviator app Download Aviator Game and give it a try—you won’t be disappointed!”