- Home /
Why will my button not let me run a function?
Why will my button not let me run a function? Heres A Picture of what I mean:
Answer by AaronXRDev · Feb 09, 2020 at 11:05 PM
Check to make sure that the function you want to call is public, and that there are no errors in the target script.
Answer by thegameguy02007 · Feb 09, 2020 at 11:08 PM
@EgoAnt Heres a picture of the code, and as far as I know no problems with the script
Answer by Klarax · Feb 10, 2020 at 12:52 PM
i believe its due to the same name of the function as the class. change the function name to something else and it should work. Also make that first letter a capital letter god damn it :P
Answer by boysunshine · Feb 10, 2020 at 01:53 PM
This happens to me every so often. Try closing unity and restarting. Reload your solution and make sure the values are set to public. Sometimes it just doesn't seem to make that connection.
Your answer
Follow this Question
Related Questions
Missing function in button on click 1 Answer
I made an resume button, but I don't know how to code it to close my pause menu, any tips? 2 Answers
I need to move a sprite when an UI button is clicked 1 Answer
Canvas Button OnClick() function arguments 1 Answer
Change scene and play it by clicking UI Button? Scene does just load but not start playmode? 1 Answer