- Home /
Question by
trueplayer · Jun 04, 2014 at 10:32 AM ·
guitextureguitexturehittest
GUITexture HitTest not registering
OK, I've been trying to get it working for the last hour and it's getting frustrating. I simply want to detect a click on GUITexture (old-style, not new fancy GUI stuff).
I have a GameObject of GUITexture type in the scene - this GameObject is called NoteIcon. The code in main camera Update method is as follows:
GameObject go = GameObject.Find("NoteIcon");
GUITexture gt = go.guiTexture;
bool a = gt.HitTest(Input.mousePosition);
Debug.Log (a);
a is ALWAYS false, whether I'm clicking on the object or not. Why the hit is not detected properly?
Comment
Your answer
Follow this Question
Related Questions
GUI Texture Problem 3 Answers
Reduce Draw call for Multiple GUI Textures with same Texture 1 Answer
GUITexture Button? 1 Answer
GUILayer hit doesn't work. Any help? 0 Answers
How do I make certain GUI textures be in front of other GUI textures? 2 Answers