- Home /
Block UnityGUI Hit
Hi,
I am using the Unity GUI in my project, and it works fairly well.
However, when I tap a button (this is iOS), the tap is still sent to my app, and subsequently the rest of my app reacts. For my type of project this is not desired behavior.
So, basically, how can I block a GUI hit being sent to the rest of my app?
Answer by Statement · Aug 14, 2011 at 10:19 AM
IIRC this is one of those headache moments where you have to write manual tests to see if the tap happened within any GUI areas anywhere you want to use Input. There are probably tons of threads about this problem, with proposed workarounds. Here's one for example.
Thanks for that. I have decided to use Rect.Contains to see if the tap is in the rectangle, and if it is, do not react on input; if anyone in the future is wondering.
Your answer
Follow this Question
Related Questions
conversion rate for a touch in local space and for an object in local space 1 Answer
How do I Scale a GUITexture or GUIText for different resolutions screen sizes on the iPhone? 1 Answer
I am having a problem with momentum of an object after releasing a touch from the iPhone. 2 Answers
iPhone joystick? 0 Answers
How could I create a dynamic cartoon style speech bubble? 1 Answer