[VR] How to display a canvas with Oculus

Trying to make a crosshair follow the oculus using the canvas. Currently I’m using images on the canvas to draw the crosshair. I was originally using screen space- overlay and it was showing up in the unity editor but when the project was built it would not appear in Oculus. I also tried screen space - camera and it was appearing but it was far in the distance and hiding behind objects. I tried changing the plane distance but Unity would crash when I tried running it in the editor. Does anyone have any suggestions on how to make this work.

Hey, I don’t know if you’re still struggling, but I found a solution for the UI with the Oculus.

Create a 2nd camera and make it a child of your main camera (CenterEyeAnchor if you use OVRCameraRig)

  • Set the Clear Flags on Depth only
  • Set the Culling Mask on Nothing first, then only enable UI
  • Make the depth 1 (or anything higher than your main camera)

This covers the camera, now you have to make the Canvas render in Screen Space - Camera
Select the camera you just created, I call it UI camera, as the screen space renderer.

Now you have a transparent camera overlay with only UI elements that renders in the oculus.

I also want to add, the oculus renders the frustrum not as usual, you have to place your UI elements much closer to the center, but that is up to you.

This worked great for me. Thanks for your clear description!

Awesome solution! Thank you @RicusMaximus :),Awesome solution. Thank you very much!

Thank you so much for this tip, @RicusMaximus :smiley: It works brilliantly!

Thank you so much