0
\$\begingroup\$

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).

\$\endgroup\$

1 Answer 1

2
\$\begingroup\$

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.

\$\endgroup\$

You must log in to answer this question.

Not the answer you're looking for? Browse other questions tagged .