Search Unity

  1. Welcome to the Unity Forums! Please take the time to read our Code of Conduct to familiarize yourself with the forum rules and how to post constructively.
  2. Dismiss Notice

Question how to place an ui image/button on top of enabled vr mode?

Discussion in 'XR Interaction Toolkit and Input' started by prorender, May 11, 2022.

  1. prorender

    prorender

    Joined:
    Apr 30, 2022
    Posts:
    8
    I want to add an additional button in enabled VR mode. When I place a canvas with an image (fullscreen icon) and go to VR mode the canvas UI is not shown. When I go back to 2D mode the UI is shown. The VR mode has only a "x" icon on top left and a "gear" icon on top right. But I want to add a third "fullscreen" icon on top right in VR mode. It seems that the VR mode is in front of all other UI elements und hides all. Any advice how to do that?
     
  2. NemesisWarlock

    NemesisWarlock

    Joined:
    Jan 21, 2017
    Posts:
    141
    Straight up? don't use Screenspace or overlay UI modes in VR apps. It causes issues at best, and can murder performance at worst.

    Use a world space UI, and make sure the VR Rig main camera is the raycast cam.
    (also, make sure that you replace the graphic raycaster with a Tracked Device graphic raycaster.)

    you can still have it locked to the player's view, and to the player be the same as a screenspace UI, just make the canvas a child of the main camera.
     
  3. Fressno

    Fressno

    Joined:
    Mar 31, 2015
    Posts:
    185
    Is there any chance you could show how you do this?
    im lost in your explanation. sorry