Let Click go through GUI

I must be the first person to ask this, since I only see people asking the opposite…

I’m drawing my GUI this way:

function OnGUI() {
     GUILayout.BeginArea (Rect(posX, posY, szX, szY));
     GUI.Box(Rect(0, 0, szX, szY), Title);
     Draw();
     GUILayout.EndArea ();
}

But it blocks clicks from passing through it as normal, how can I deactivate such feature?

Thanks!

One alternative is to replace your OnMouseUpAsButton by Raycast calls. It’s not elegant, but works.

var hit : RaycastHit;
if (Physics.Raycast (ray, hit)) {
    // Your code here
}