x


guiText.HitTest(Input.mousePosition) is not triggering

I have a GUIText object that I cam trying to do some hover and click states for, but the Hit Test is not triggering.

By printing the guiText.GetScreenRect() I was able to find out that it has a height of zero, which would mean that the hitbox could never be hit.

(left:363.50, top:38.00, width:77.00, height:0.00)

I have tried both with and without a collider attached with the same result.

Is this a bug in the hitbox calculation or am I just messing it up?

if(guiText.HitTest(Input.mousePosition)){
    //do the things
}
more ▼

asked Mar 17 '12 at 03:02 AM

VarnishedOtter gravatar image

VarnishedOtter
0 1 1 1

(comments are locked)
10|3000 characters needed characters left

0 answers: sort voted first
Be the first one to answer this question
toggle preview:

Up to 2 attachments (including images) can be used with a maximum of 524.3 kB each and 1.0 MB total.

Follow this question

By Email:

Once you sign in you will be able to subscribe for any updates here

By RSS:

Answers

Answers and Comments

Topics:

x3816
x983
x567
x194
x42

asked: Mar 17 '12 at 03:02 AM

Seen: 691 times

Last Updated: Mar 17 '12 at 03:02 AM