- Home /
GUI.Button click trigger game object
How can I prevent a GUI.Button click go through the Game area, currently when I was clicking on the GUI.button which cover a game object it will also trigger my game object action too.
Answer by jordanmisiura · Oct 31, 2011 at 06:06 AM
pull the raycast code you are doing out of the update loop you are using for it. Instead, in your gui code when you check for button presses, assign a mouse action that the gui code won't use as your raycast method. If your gui code doesn't use a mouse down event, for example, then you can add your raycasting there.
Your answer
Follow this Question
Related Questions
Help with GUI clicking ??? 1 Answer
Unity GUI Button Options 0 Answers
Custom GUI Button is Black 1 Answer
Problem in setting GUI Button for mobile device 1 Answer
Screenshot certain layers so it doesn't show GUI Button on the image?? 0 Answers