How do Pointer events work? 4.6 UI

I understand how to place event triggers on the new UI objects, but I don’t understand how some of their mechanics work.

For one, do the Pointer events (Enter, Exit, Drag, etc.) use colliders to determine if the cursor is over the particular object? I have placed events on panels, and they work well, but I do not put any colliders on those panels. If they don’t use colliders, then how do they do work?

I’ve been using a canvas set to Screen Space - Overlay. Pointer events work well and accurately. But when I use a MouseOver function on the same object, even with a collider, Unity doesn’t recognize when my cursor is over it… unless the object itself is truly in front of the camera (unlike the Pointer events that recognize the overlay’s positioning). Why is that? How can I solve that?

Is there a way to edit how a Pointer event works so I can tweak it to my need or at least see how it works so I can apply those methods to my own scripts? Is there a way to determine if my cursor is over an object (and only the front object if there are objects behind it) without using a collider?

And, most importantly, is there a PointerOver event hiding anywhere?

Thank you!

The idea behind pointer events is to make life easier to manage input from mouse and touch screen input. Rather than you having to manage ray caster into the game world and worry what you’re interacting with, you only have to worry about is how to manage input interaction on game objects when it happens. The way the scene detects input is via RayCaster components.

For interaction UI components, you need to put a Graphics Raycaster on a canvas. For interaction for 2D and 3D physics components you need a Physics2DRaycaster and PhysicsRaycaster respectively on the camera which is viewing your scene.

If you want objects in your scene to be interacted with by the respective ray caster, 2d and 3d objects need a respective 2d or 3d collider and for the ui, all ui components can be interacted with by default unless component is deactivated or they have a parent canvas group component that doesn’t block ray casts.

You will also need to be aware what layers your objects are on and what layers your ray casters can interact with. Basically you can ignore objects on certain layers if you try and click on them.

As for PointerOver - I believe event you want is the PointerEnter event. It will fire when your pointer is over an object it can interact with.

If this doesn’t answer your question properly then let me know.