Multiple cameras and the event system (events not firing)
Posted: Mon Feb 01, 2021 2:30 am
Hey Tony!
I'm having a problem with catching events on a world space camera.
I realized this problem when I tried moving the response panel to a speech bubble, and I can't get it to register clicks. I would also need this to be able to click a bubble to skip a subtitle.
I have a camera stack with 3 cameras:
- Main camera - Normal camera that renders everything except UI and WorldSpaceUI
- UI Camera - This renders a screen space overlay canvas for the UI layer
- WorldSpaceUI Camera - This renders a world space canvas, to make speech bubbles appear in the world space, but over UI. The reason for this is so that when the player speaks a line, an UI popping up, shouldn't cover the speech bubble.
But no matter what I seem to do, I can't get any events to UI on the WorldSpaceUI Camera.
I noticed an old question on the Unity forum by yourself (https://forum.unity.com/threads/how-to- ... me.268044/) which might be related to this.
When I look in the Event system, i get no other events when hovering the speech bubble, so I don't think it's anything blocking it.
Is it that you need one event system for each camera for clicks to function properly? If so, how do I set that up? I can't find any settings to connect an event system to a specific camera?
A note is that I used to have the speech bubbles in a Screen space overlay canvas and position them to follow the player, but I think they lagged behind when the player was moving, which I didn't think look good.
Thanks in advance for any ideas
I'm having a problem with catching events on a world space camera.
I realized this problem when I tried moving the response panel to a speech bubble, and I can't get it to register clicks. I would also need this to be able to click a bubble to skip a subtitle.
I have a camera stack with 3 cameras:
- Main camera - Normal camera that renders everything except UI and WorldSpaceUI
- UI Camera - This renders a screen space overlay canvas for the UI layer
- WorldSpaceUI Camera - This renders a world space canvas, to make speech bubbles appear in the world space, but over UI. The reason for this is so that when the player speaks a line, an UI popping up, shouldn't cover the speech bubble.
But no matter what I seem to do, I can't get any events to UI on the WorldSpaceUI Camera.
I noticed an old question on the Unity forum by yourself (https://forum.unity.com/threads/how-to- ... me.268044/) which might be related to this.
When I look in the Event system, i get no other events when hovering the speech bubble, so I don't think it's anything blocking it.
Is it that you need one event system for each camera for clicks to function properly? If so, how do I set that up? I can't find any settings to connect an event system to a specific camera?
A note is that I used to have the speech bubbles in a Screen space overlay canvas and position them to follow the player, but I think they lagged behind when the player was moving, which I didn't think look good.
Thanks in advance for any ideas