Script doesn't work.

I have prepared script =.cs file and trying to execute it in button’s onclick() method.everything is right but still nothing happens when I click on button at runtime.
Where can be the problem??

We’re probably going to need to see the code before any real diagnosis can be made.

2 Likes

My guess is that you did something wrong.

4 Likes

How can you guess that? he clearly stated:

Please don’t make assumptions! :wink:

1 Like

I must have missed that. Then it’s probably a bug in the programming language.

1 Like

Hello friends.thanks for your interest.
Now the problem is solved . Button is included into the canvas.so I added one component ‘Graphic Raycaster(script)’ to canvas and the script starts working for button.