UI input in a scene with multiple cameras/viewports

Hi there,

I have a project with a scene that has multiple cameras with different viewport sizes , but only one camera is rendering the 2D UI layer.

The problem is that the UI seems to be receiving input from all the cameras in the scene (rollovers, clicks etc), instead of just the one camera that’s actually rendering it.

Is there any way to fix this?

https://playcanvas.com/project/641196/overview/multiple-viewport-input
(the button rollover state triggers when rolling over the top or bottom of the screen to see the problem)

Hi,

Yeah currently all enabled cameras are taken into account when checking input. We can add an issue in our engine to change this behaviour.

Hi Tchom,

If you put a fullscreen 0% opacity background image behind your UI and select “Use Input”, it will block the other camera viewports from receiving rollovers.

1 Like

Hi also facing same issue,
I have two cameras in the scene. One camera only rendering UI. And another one only rendering 3d Model.

Scene

On the UI I have one button. The issue is that button is interactable by 3d camera. In 3d camera, the UI is not visible but interaction is happening.

Project

Any Idea how to restrict UI interaction from that 3d camera?

Thanks this logic got worked :+1: :+1: