Let's say I have two Canvases: BackgroundCanvas and UICanvas.

Now, on BackgroundCanvas I have multiple moving, not clickable objects so I removed the GraphicRaycaster (+ 69 to performance).

On the UICanvas, all the objects are on the UI layer. I also have some additional layers somewhere else.

Now, if I change the GraphicRaycaster's (on UICanvas) blocking mask to UI only, would it improve performance if there are other objects on the Default and other layers? Or would it still ray all these objects on other layers?

How does this really work? I'm asking cause I don't see any performance impact while switching these Blocking Masks, but after disabling the entire component - I do (but the input is not working ;S).


No, changing the blocking mask won't improve performance. For example, even if you set the blocking mask to Nothing in your UICanvas, the calls will be triggerd the same. Same goes if the children objects are inactive.

One quick way to improve performance by reducing calls is to disable the Raycast Target bool in all the children objects that shouldn't be checked by the raycaster.

| improve this answer | |

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

Not the answer you're looking for? Browse other questions tagged or ask your own question.