Trying to put a 3D object above GUI for Hololens

Hi, I’m kinda new to Unity and I’ve been facing this problem recently. I have a 3D plane, a cursor wich is a 3D object, and two buttons on a Canvas, accting as a Menu. When I move around, I can see the cursor on the surface of the plane, but when it gets to the buttons, it looks like it hides behind the buttons, but it allows me to click on them. So I have a cursor that “works” , I can click on the buttons when I’m on then, but it’s not being shown above these buttons so the user can see the cursor.

I’m programming for Hololens so I’ve got the canvas “render mode” set to World Space, using the Main Camara as the event camera. The Main Camera need to have the “Clear flags” to solid color and with color black, so I can see the room where there is black in the project.

79200-captura.png

This is a image of my problem. I want the cursor to be seen above the button. Any ideas?

I solved this problem using an additional camera:

  1. Add a new layer “Cursor” and move just the cursor object to this layer.
  2. Set the main camera to draw all layers except Cursor.
  3. Create another camera. Set the Clear Flags to “Depth Only”, Depth to something > main camera depth, and Culling Mask to just the Cursor layer.

Under this configuration:

  1. The main camera goes first, drawing everything but the cursor layer.
  2. The secondary camera goes next, clearing the depth buffer of the main camera, and draws just the cursor on top of everything else. The ray cast from the Gaze Manager should make the cursor approximately the right size.