- Home /
Question by
xAdamQ · Jun 13, 2017 at 11:58 PM ·
uicanvasbackground
Sprites doesn't block Raycast from UI
Hello, I have sprites and background behind them in a CameraCanvas. The problem is when I click on a sprite has a collider component the Raycast click also on the background that must have a different function.
note: I can't make the background sprite because it's tiled.
Comment
Answer by LazyKnight · Feb 19, 2019 at 03:34 AM
I didn't found a solution to block raycast from UI but you could do this by scripting.
See:
How to prevent clicking a gameobjects behind a Canvas/Panel?
Reference: EventSystem.IsPointerOverGameObject (In fact this is "Pointer Over GameObject")
Hope this help.