Search Unity

3D Objects in a Canvas - what is best practice?

Discussion in 'UGUI & TextMesh Pro' started by mr_blahblah, Jan 9, 2020.

  1. mr_blahblah

    mr_blahblah

    Joined:
    Jan 15, 2016
    Posts:
    38
    Post title is pretty self-explanatory, but - I can't find a definitive answer on this via searching the forums etc.

    Can someone with experience weigh in? Is there a way to do it without scaling 3D objects by gigantic factors, for example (as the typical case is with say, a 3D object that is a child of a canvas)...

    Should I simply write my own solution, or does Unity have support this properly out of the box (so to speak), and have I missed something painfully obvious?
     
  2. mr_blahblah

    mr_blahblah

    Joined:
    Jan 15, 2016
    Posts:
    38
  3. mr_blahblah

    mr_blahblah

    Joined:
    Jan 15, 2016
    Posts:
    38
    Example:

    I have a 3D scene, with a 2D UI - 2D UI is on its own layer & canvas, and as its own (depth) camera. Works fine.

    If I add a 3D object to that canvas (set to overlay), it doesn't render. I need to scale it up by say, x1000 for it to be of a viable size - but it's not a scale issue. It just doesn't render.

    So, if I change the canvas render mode from Overlay to Screen Space Camera, the UI disappears, until I push the camera depth up a bit. Now I can get a 3D object to render, however it needs to be scaled up to even crazier values, and that frankly unnerves me - this feels like it should be supported via base UI functionality, so I'm other missing something - or Unity doesn't support 3D objects in its native UI system without a series of weird steps and hacks.

    Is it the former, or the latter?
     
  4. mr_blahblah

    mr_blahblah

    Joined:
    Jan 15, 2016
    Posts:
    38
    *tumbleweeds*
     
  5. simpleonegame

    simpleonegame

    Joined:
    Dec 17, 2019
    Posts:
    13
    May be this would help