I have a 2D Unity project, where I can highlight sprites by moving the mouse over them and responding to the OnPointerEnter via IPointerEnterHandler and dimming the sprite.
I also have empty GO’s with Collider 2D’s set to trigger that respond to the player walking into them and offering a quest for example.
However when they overlap, the former (sprite highlight) never happens and I don’t see a way to change layer orders or something.
I’ve tried putting the trigger collider 2d on the ‘Ignore Raycast’ layer, which in theory should work, but it doesn’t.
How do I fix this? BTW I wont use a solution that polls in Update or the like
Ah I see what you mean. I only did half the job. I was assuming that the ‘Ignore Raycast’ layer was already set up to be ignored when it wasn’t.
So yes, I changed the raycast to ignore that layer and it now works.
Thanks
I feel silly for not testing that earlier.
So you know though, none of this is 2D. Neither the physics team nor the 2D team created it, use it or maintain it. It’s all UI stuff. This is also true for the Physic2DRaycaster.