- Home /
UI 4.6 Image blocks Mouse Click
I have a Scroll Rect with a Mask. As a Child, I have an Image that I use for the content of the Scroll Rect. If you click on the image and drag the mouse, it behaves correctly. It slides up and down.
However, I need to add another Image on top of that to make it look better. I added a new image that is on top of the ScrollRect. The problem is that now I cannot use my mouse to select the contents of the ScrollRect because the new Image is on top of it.
Is there a way where I can have an Image that doesn't accept mouse clicks, so that I may click on Images underneath it instead?
Answer by troien · Nov 13, 2014 at 02:33 PM
You can add a CanvasGroup component to your Image, and set the Interactible and Block RayCasts to false.
(Unity 4.6.0b20)
I assume that in the future you would be able to use layers and set the Graphic Raycaster Blocking Mask, but I think this is not implemented yet in this version of Unity. Since nothing seems to change when I change this value :p
I tried this solution and it seemed to work fine at first, but later I noticed that sometimes the settings change and I don't know why.
I have a prefab that contains multiple UI-objects and for some of those I have added the CanvasGroup component with Interactable and Block Raycasts set to false. I add the prefab dynamically from the Resources folder. Sometimes Interactable and Block Raycasts is set to true again. I can't figure out why it happens.
I've had this happen in different prefabs. I noticed the Ignore Parent Groups but that has no effect whether it is on or off, also the parents don't have CanvasGroup added.
Do you have any idea what could be affecting the settings of the CanvasGroep component? Could this be a bug? Any help would be appreciated!
Your answer

Follow this Question
Related Questions
[4.6 - UI] Accessing Text in Image inside Canvas via C# Script 3 Answers
9 Sliced Image Is Bleeding Edges 0 Answers
Help with 3 star reward system 2 Answers
Unity 4.6 beta: Can I use best fit with text on an image instead of a button? 0 Answers
[4.6] How can I make children images not stretch with the parents? where to place anchors? 1 Answer