Search Unity

How To Prevent UI from Clipping Through Game Objects?

Discussion in 'UGUI & TextMesh Pro' started by Don_NVS, Apr 17, 2018.

  1. Don_NVS

    Don_NVS

    Joined:
    Dec 23, 2013
    Posts:
    34
    Hello Everyone,

    I’m working on a VR game and trying to make a Pause Menu using World Space on the canvas. The problem is, when the user moves their head in certain areas of the level with the Pause Menu open, the UI elements clip through things like walls. I tried making a dedicated UI camera that only renders the UI but it had too much of an impact on performance. Is there a way to render a World Space canvas on top of all other game objects?
     
  2. Zonlib

    Zonlib

    Joined:
    Apr 15, 2014
    Posts:
    39
  3. Don_NVS

    Don_NVS

    Joined:
    Dec 23, 2013
    Posts:
    34
    Thank you for sharing the link. I believe that will work. I’m gonna try it out today.
     
  4. evan_spiegel

    evan_spiegel

    Joined:
    Jul 17, 2019
    Posts:
    26
    Hey there, just wondering, did this work for you? I'm having a similar issue in my VR Oculus Quest app where the UI menus are clipping through the environment meshes.
     
  5. Don_NVS

    Don_NVS

    Joined:
    Dec 23, 2013
    Posts:
    34
    Yes that worked for us.
     
  6. evan_spiegel

    evan_spiegel

    Joined:
    Jul 17, 2019
    Posts:
    26
    Awesome, I'll give it a shot thanks!
     
  7. VoltDriver

    VoltDriver

    Joined:
    Nov 16, 2019
    Posts:
    8
    Thanks for that link! I found the solution from Julien-Lynge to be the most useful one to do what I wanted to do.