Search Unity

  1. Unity support for visionOS is now available. Learn more in our blog post.
    Dismiss Notice

Question How to get "Screen Space Overlay" effect with "Screen Space Camera" or "World Space"?

Discussion in 'VR' started by GerenMeric, Aug 3, 2023.

  1. GerenMeric

    GerenMeric

    Joined:
    May 15, 2023
    Posts:
    47
    Hi everyone,

    I am trying to make a menu for vr (Oculus Quest 2) and i want to see nothing other than the menu in the vr headset while in the menu. When, i have tried Screen Space Overlay canvas setting, i see an empty scene without a menu visible. When i use Screen Space Camera, the menu doesn't cover my screen in VR headset. So, i don't see only the menu. I Also see the skybox to sides of the screen of the VR headset. Is there a way to make only the menu to be seen in vr? Or is it impossible to only see the menu in vr?
     
    Last edited: Aug 7, 2023
  2. DevDunk

    DevDunk

    Joined:
    Feb 13, 2020
    Posts:
    4,883
    If you only want to see a menu just create a menu scene, or add a fully black background image, which stretches to the canvas size.
    Note that every headset has a different FoV and resolution. Most VR games use world space menus for that reason (also more natural to navigate usually).

    If you have an issue where the UI clips into 3D models use some kind of overlay shader
     
  3. GerenMeric

    GerenMeric

    Joined:
    May 15, 2023
    Posts:
    47
    Thanks for the advice, unfortunatelly the world space wouldn't keep me from seeing the skybox
     
  4. DevDunk

    DevDunk

    Joined:
    Feb 13, 2020
    Posts:
    4,883
    Send screenshots if you have visual issues
     
  5. GerenMeric

    GerenMeric

    Joined:
    May 15, 2023
    Posts:
    47

    Here is what i see in the playmode:

    the_view.png

    You can see the skybox around the canvas (the menu) here. But, i don't want to see that skybox around my menu. I want to see only the menu.

    These are my canvas settings:


    canvas_settings.png


    And these are my camera settings:


    camera_settings.png

    camera_settings_2.png
     
  6. DevDunk

    DevDunk

    Joined:
    Feb 13, 2020
    Posts:
    4,883
    Yes, you use constant size. Then it wont scale even on flat screen.
    Change the canvas scaler and read up on how to implement UI in Unity
     
  7. GerenMeric

    GerenMeric

    Joined:
    May 15, 2023
    Posts:
    47

    Thanks for the suggestion. Just tried changing canvas scaler to "Scale With Screen Size". While the problem persists in playmode inside Unity, when put the vr headset, i see that the canvas became too big.

    Here are my canvas settings:


    new_canvas_settings.png


    As you can see here, while i changed the canvas scaler to "Scale With Screen Size".

    Here are my camera settings:


    new_camera_settings.png


    As you can see here i unselected the "Physical Camera" option.
     
    Last edited: Aug 9, 2023
  8. GerenMeric

    GerenMeric

    Joined:
    May 15, 2023
    Posts:
    47
    Thank you so much for your suggestions. I did play with Canvas settings and even though the result wasn't a full screen menu, it was pretty close with the skybox only visible to corners of the screen of the vr headset. I did this using following canvas settings and without touching camera settings:


    new_canvas_settings.png
     
    Last edited: Aug 10, 2023