Search Unity

Discussion Building user interfaces for AR/VR

Discussion in 'VR' started by virtualmaker, Jul 19, 2022.

  1. virtualmaker

    virtualmaker

    Joined:
    Oct 22, 2016
    Posts:
    82
    Hi, I was wondering what tools AR/VR devs use today to build user interfaces. There are various features in Unity UI like horizontal/vertical layouts, grids, pivots, margins, etc. that I would want to use, but I don’t want to be limited to "flat UI". Here’s some examples from of what I mean:

    Flat UI, but positioned in 3D space



    Panels overlapping in 3D space


    Mix of 2D and 3D content in a layout:


    "Popping out" 2D panels for more appealing UI


    I’ve been tinkering with a tool that I think could help build these types of interfaces (see post), but I’m trying to understand if there’s already some decent solutions or issues that I don't know about.
     
  2. DevDunk

    DevDunk

    Joined:
    Feb 13, 2020
    Posts:
    5,059
    I personally have used CurvedUI. You can also make multiple canvasses. The last example could have 2. 1 for background and 1 for UI elements to pop out
     
  3. virtualmaker

    virtualmaker

    Joined:
    Oct 22, 2016
    Posts:
    82
    Thanks! CurvedUI looks interesting. For your suggestion about 2 canvases, I’m not sure that would work dynamically - resizing one canvas wouldn’t affect the other or is there a way to achieve that?
     
  4. DevDunk

    DevDunk

    Joined:
    Feb 13, 2020
    Posts:
    5,059
    Wold canvasses can be scaled. You can put both under 1 parent gameobject and then you can scale both at once
     
  5. virtualmaker

    virtualmaker

    Joined:
    Oct 22, 2016
    Posts:
    82
    Sorry, I was being vague. When I said "resize" I meant changing the width/height on the RectTransform. Similar to resizing a browser window, I'd expect the contents to reflow.

    I played around with this, and to my surprise, it somewhat worked. The child canvas does use the rect size of the parent canvas, and can even be offset in Z!

    There's still some things missing details for this to be ideal. I can't panels any depth or shadow. So I added a child cube mesh and wrote a custom script to resize it to match its parent rect transform. That works, but I have to do it in Update(), since I haven't found a way to detect rectTransform size changes. Still, it works!
     
    DevDunk likes this.