I’m using 2D URP with the new input system, and trying to get GameObject clicks. Most work, but not all. Some seem to be blocked by sprites behind them.
I have an EventSystem.
I have a 2D ray caster on the Camera.
I have IPointer as the interface and the method implemented.
The objects are not children of a canvas, and there are no UI objects in front of them.
The layer order is correct (they are being drawn in front), and the sorting order is set.
These objects are prefab instantiated.
The objects have colliders on them (since some are working).
The up/down/click events work when the objects have scene instance (not prefab) objects behind them (and the objects are children). However when I have other prefab instantiated objects behind, they are not registering.
Does anyone have any thoughts why this may be?
Roughly:
Scene
- UI
- World
- Prefab (Big): Sort: Default, Order: 1
± Prefab (Small to be clicked): Sort: Resources, Order: (random positive number)
Layers:
- Background
- Default
- Resources