turn off mouse events on gameObject?

This should be simple… but I am stumped: how do I turn off mouse events on a gameObject?

I have one gameObject (A) in front of another gameObject (B).

I have the renderer of A disabled but it still blocks mouse events going to B. I can’t see how to disable the Box Collider on A so that it is transparent to mouse events.

little push in the right direction?

–Roy

Put (A) on the Ignore Raycast layer.

–Eric

Can I do that programmatically?

gameObject.layer = 2;

–Eric

gameObject.layer is your friend.

thanks - finally found that. arrgh. 2 hour tangent…