Adding multiple cameras to a Unity XR scene?

Hey everyone,

Is it possible to add multiple cameras to a scene when using Unity XR?

Whenever I add another, it seems to think it’s the head of an XRRig, updating the position and rotation to match the HMD. It is however neither attached to the rig nor tagged as the “MainCamera”.

The extra camera is used as an overlay for the player’s hands and UI.

What I’ve noticed is that by disabling the Camera component, it doesn’t seem to behave like this anymore. I then thought of attaching a script to the mainCamera and manually rendering the overlayCamera in the PostRender() method, however this produced some weird results!

Not sure if this is a bug or not, but I’ve been battling with this for longer than I’d like to admit haha. If anyone has any suggestions, I would really appreciate the help! :slight_smile:

Thank you for your time!

You can render the second Camera into a Render Texture, and then use the Raw Image component in a World Space Canvas to display it where you want.

Create a Render Texture asset using Assets > Create > Render Texture, then on the second Camera set Output Texture to that asset. Then on the Raw Image, set Texture to that same asset.

1 Like

I tried doing the same thing here but Its not giving the intended effect, what I want to happen is that the image should stay in place