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

Web Publishing - How to get the View port view = Game view

Discussion in 'Editor & General Support' started by Markedavis2001, Mar 19, 2015.

  1. Markedavis2001

    Markedavis2001

    Joined:
    Nov 20, 2013
    Posts:
    30
    Hey guys,

    Exporting my first Unity project to the web and I'm having some really weird bugs.

    In my opening scene which is a title screen in two buttons. In the viewport everything is visible and reasonably placed. However upon exporting, you can only see the top left corner of the background. The only camera in the scene is the default UI camera for the canvas.

    In my other scenes things are better, but the edges are being cut off.

    I've found a few posts about this same subject but they seem to be older, before Unity 5 and/or before the new Unity UI. I'd like to be able to get my view port view to be close/same as my export settings so that I can properly place the UI and get things in place.

    Can anyone point me in the right direction at least? I'm a bit of a novice so please use small words. :)

    Thanks!

    ~Mark
     
  2. Markedavis2001

    Markedavis2001

    Joined:
    Nov 20, 2013
    Posts:
    30
    Judging by the number of views and the lack of answers I've found so far in my searches this might be a unknown for a lot of people. There's got to be a good way to see what your game will look like before you export it. Or am I missing something obvious here?
     
  3. Dantus

    Dantus

    Joined:
    Oct 21, 2009
    Posts:
    5,667
    It would help a lot to see some screenshots.
     
  4. Markedavis2001

    Markedavis2001

    Joined:
    Nov 20, 2013
    Posts:
    30
    Duh - great idea. Here's an example. Though I'd really like to know if there's a way to make your view port look like your gameport - feels like there really ought to be a way to make this happen.

    Anyway - any help anyone has would be greatly appreciated. In the screenshots below, I've nothing in my scene but the UI/Canvas.
    Viewport being what I see in the Unity tool, game being what I see in the browser. ViewPort.png GamePort.png
     
  5. Dantus

    Dantus

    Joined:
    Oct 21, 2009
    Posts:
    5,667
  6. fffMalzbier

    fffMalzbier

    Joined:
    Jun 14, 2011
    Posts:
    3,276
    My guess would be that you have to use the Rect transforms anchoring system and the canvas scaler to make your UI fit to the web-players resolution.
    If you change the resolution of your game view you should see how different resolutions affect the UI.