Image blocking raycast when there are two canvas

Hi,

I am using version 4.6.1p2

I have setup two Canvas, both of them are Screen Space.
The Image at the lower Canvas would block raycast to the button of the upper Canvas.
Is this an expected behavior or something wrong?

Please find the scene in the attachment.
Thanks.

1895958–122095–GUITest.7z (34.3 KB)

I’m running into a similar/same problem that I’d like to solve.

I have multiple canvas’ that have well defined “order in layer” numbers. (0, 99)
The rear canvas has an image (among several other things that appear to be impertinent).
The front canvas has a button (among several other things that appear to be impertinent).

The rear image appears to catch the cast of the button thereby making it inaccessible (or partially inaccessible when not completely encompassing the button).

Everything visibly renders correctly. However the button interaction is obscured.

A working temporary solution is to disable the Graphic Raycaster on the canvas that is interfering.

gameObject.GetComponentInChildren<GraphicRaycaster> ().enabled = true;

Doing so allowed the button to function while still allowing the image in the background to draw.

Of course in my situation I’m not losing any functionality by doing so. This may be different in your case.

1 Like

Currently the system didnt take the order into account properly. That was “fixed” in 4.6.1p1 or at least was tried to be fixed.

In the end i just rewrote the whole ordering of the events. its not in a official release yet but try building https://bitbucket.org/philip_cosgrave/philunity-uibugfixes/branch/eventsystemrewrite It should have the proper fix if all is correct.

Hi phil,
the problem is gone after applying your branch, thanks!

Great news :slight_smile: I’ll likely get this into the main branch then and get it into the one of the next releases.