Search Unity

Resolved Gaze cursor rendering behind canvas

Discussion in 'AR' started by ahoffmann, Dec 16, 2020.

  1. ahoffmann

    ahoffmann

    Joined:
    Dec 10, 2018
    Posts:
    10
    Goal: I have a custom gaze cursor (not built on an existing XR framework) that I want to always be overlaid on top of all other world space objects and UI.

    Problem: When a world space canvas's "order in layer" field is set to > 0, the canvas renders on top of my gaze cursor. So I'm looking for any info about why this happens and what can be done about it.

    Details:
    My gaze cursor is a quad-like mesh with a transparent material. I have previously been getting the cursor to overlay other transparent objects by increasing the render queue value of the material to around 3050. But that doesn't seem to work on canvases if their "order in layer" is above zero (I tried cursor render queues as high as 5000). The issue happens regardless of whether the cursor is in front of or behind the canvas. Currently using Unity 2019.3.6, targeting Android.

    Here is a sample Unity project that reproduces the problem: Gaze Cursor Render Order Test.zip
     

    Attached Files:

  2. ahoffmann

    ahoffmann

    Joined:
    Dec 10, 2018
    Posts:
    10