Reputation: 1
I have this problem. I wrote a script with a method when interacting with which the player exits the game, but when I wanted to bind it to the button, and I realised that it didn’t work . In the OnClick() component, I attached my script, but for some reason the method is not attached.How can I attach my method?
Upvotes: 0
Views: 138
Reputation: 338
Create an empty GameObject
, attach your credits.cs
to it then assign this gameobject to the OnClick()
, then Credits > (Your method).
Make sure your method is public
.
Upvotes: 1