I’m having some trouble with getting events to register in my Event System
. My setup is:
- A main canvas with
Render Mode
=Screen Space - Overlay
with aGraphics Raycaster
and the other default components - Several child objects with image components that have raycast target checked (and several with interactable components like Button/Toggle)
- An
EventSystem
with aStandalone Input Module
and some custom scripts
I am looking at the bottom of the inspector to see what objects are registering with the Event System
. With the setup described above, nothing registers except for the position of the mouse. BUT, if I put Graphic Raycaster
components on the actual objects that I’m trying to hit, then suddenly everything works - I am able to hover over an object and see pointerEnter
set to the object, and I can click and use my scripted events.
From what I’ve read, there should only be a need for a raycaster on the Canvas
, and the setup I described above should be sufficient the EventSystem
to pick up when I’m hovering over/clicking an object without ray casters on those objects. What am I missing?
Update: I found that the prefabs of the parent objects of the objects I’m trying to detect had a render mode of World Space. After switching to Screen Space, I was able to detect the parent objects, but still not the child objects. But I don’t see why that should matter because when the parent object is instantiated, it loses the render mode field in the inspector (presumably because there’s the main canvas overriding it?
Still not working as I want, but hopefully the extra info is helpful.