Coming soon - Get a detailed view of why an account is flagged as spam!
view details

This post has been de-listed

It is no longer included in search results and normal feeds (front page, hot posts, subreddit posts, etc). It remains visible only via the author's post history.

1
New to Unity, and I am stuck with a button on click event not working!
Post Flair (click to view more posts with a particular flair)
Post Body

Hey!

I'm working on a tutorial for a quiz game and I created buttons and create a script that is supposed to handle the onClick event, I followed step by step with the tutorial, I created the script Quiz.cs and I added the component that has Quiz.cs connected to it as a script to run on the On Click() event and selected the functionality as well, but when I run the game and click the button nothing happens, been trying to figure out what I've done wrong since yesterday, maybe someone can help me figure out what's the problem.

Here is the link to the project:https://github.com/Taro-Naza/quiz-master

One thing I'm sure of is that the OnAnswerSelected method does not run when you click a button, so the problem must be when I set up the onClick event but I double checked and everything is set up exactly like in the tutorial

Thanks in advance and have a good day!

Update: Solved, turned out that the buttons canvas was behind the background canvas, and giving it a higher order fixed it! Thank you for the help, everyone!

Author
Account Strength
100%
Account Age
9 years
Verified Email
Yes
Verified Flair
No
Total Karma
17,700
Link Karma
17,335
Comment Karma
274
Profile updated: 5 days ago
Posts updated: 7 months ago

Subreddit

Post Details

We try to extract some basic information from the post title. This is not always successful or accurate, please use your best judgement and compare these values to the post title and body for confirmation.
Posted
1 year ago