Multiple cameras and the event system (events not firing)

Announcements, support questions, and discussion for the Dialogue System.
Post Reply
nicmar
Posts: 133
Joined: Wed Aug 21, 2019 2:39 am

Multiple cameras and the event system (events not firing)

Post by nicmar »

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 :)
Working on SpaceChef - A wacky open world space western, featuring a chef with nothing to loose, after he loses everything.. ;) Follow our work on @BlueGooGames.
nicmar
Posts: 133
Joined: Wed Aug 21, 2019 2:39 am

Re: Multiple cameras and the event system (events not firing)

Post by nicmar »

Hmm.. I deleted the response panel, canvas and everything and made it from scratch, then it worked, even if it was setup exactly as before.

Very weird, might be some caching or bug in Unity causing it not to register correctly.

Hope it helps someone with a similar problem. :)
Working on SpaceChef - A wacky open world space western, featuring a chef with nothing to loose, after he loses everything.. ;) Follow our work on @BlueGooGames.
Post Reply