Search Unity

GUIText Blocking a collider

Discussion in 'Immediate Mode GUI (IMGUI)' started by grimmy, Aug 11, 2009.

  1. grimmy

    grimmy

    Joined:
    Feb 2, 2009
    Posts:
    409
    I ahve a GUIText without any collider who's child is a GUITexture with a box collider.

    The image is basically a button(the child) with some text(the parent).

    The problem is if I click on the text the button object doesnt recieve the mouse clic. If I click on the button around the text this works fine.

    Does guitext block mouse clicks over other objects. If so , how do I turn that off?
     
  2. grimmy

    grimmy

    Joined:
    Feb 2, 2009
    Posts:
    409
    Hmm I am still having trouble with this one.

    I take it that everyone has no problem clicking a button (GUItexture) which has GUItext on top of it then?

    Something must be wrong (?)
     
  3. root8888

    root8888

    Joined:
    Jul 25, 2013
    Posts:
    26
    I know it's been years, but I had the same problem. Then I figured it out, so I came back here to try and help anyone else that runs into the same thing. To fix this, just make sure that the collider is closer to the camera than the GUIText. It will still render the same on screen, but the mouse clicks will be on the collider instead of the GUIText.