Search Unity

How do I make it Vertical?

Discussion in 'Getting Started' started by kristosaber, Feb 24, 2021.

  1. kristosaber

    kristosaber

    Joined:
    Jan 20, 2021
    Posts:
    33
    Hi,

    I have just created a new Mobile 2D project. However, the camera view is shown horizontal.

    May I ask how do I make it vertical?

    horizon.JPG

    I tried googling this question, but doesn't seems to get the right answer.

    Thank you.
     
  2. JoeStrout

    JoeStrout

    Joined:
    Jan 14, 2011
    Posts:
    9,859
    In the Game tab, click on the second menu from the left (it will be labeled with whatever your current screen aspect ratio is). Pick a different aspect ratio.
     
    taheralmlhem and kristosaber like this.
  3. kristosaber

    kristosaber

    Joined:
    Jan 20, 2021
    Posts:
    33
    Thank you for your helpfulness but still there doesn't seems to have any that will change my horizontal to vertical view.
     
  4. Schneider21

    Schneider21

    Joined:
    Feb 6, 2014
    Posts:
    3,512
    Cameras in Unity don't have a concept of vertical or horizontal orientation. They're merely viewports into your game's world. It's the player that has a screen size with either a fixed or (in the case of mobile) rotating aspect ratio.

    What Joe said is the best way to work. Set your Game view to a resolution/aspect ratio of your choosing. Your UI is another story... that can be set to a specific aspect ratio, but your cameras will not be.
     
    kristosaber likes this.
  5. Schneider21

    Schneider21

    Joined:
    Feb 6, 2014
    Posts:
    3,512
    Ah, I didn't realize it was you! I guess I tend to jump on questions about Unity's UI because it's one of the things I feel pretty confident in. With that said, I'm not sure what more I can tell you beyond what I've already responded in past posts of yours.

    You can add a new setting to that menu using the + button at the bottom. Change the dropdown to Aspect Ratio and enter any values that give you a portrait ratio (width smaller than height).

    For your canvas, set its Canvas Scaler Reference Resolution to something similar, except with this you have to give it a resolution. Use values that line up with the ratio you've set in the camera.

    upload_2021-2-26_8-50-52.png

    What, specifically, are you having trouble with here?
     
    kristosaber likes this.
  6. kristosaber

    kristosaber

    Joined:
    Jan 20, 2021
    Posts:
    33
    There are 2 things which I still can't figure out.

    I'm doing 2D in mobile.

    1. I want my Canvas to rotate such that from top down view, I see that it is "vertical" instead of "horizontal".
    I actually manage to do it initally when I create the x and Y axis. However I'm not sure what I did.

    2. It seems like my camera view is alway bigger than my canvas. Only when I set my canvas to "Screen space - Camera" Then, everything seems better. My canvas and screen are the same size.

    Hope someone can help.
     
  7. kristosaber

    kristosaber

    Joined:
    Jan 20, 2021
    Posts:
    33
    I'm going to try what you suggest here as well.
     
  8. Schneider21

    Schneider21

    Joined:
    Feb 6, 2014
    Posts:
    3,512
    1. Set Game window to 9:16 ratio
    2. Set Canvas to Overlay and Canvas Scaler to 1080x1920 reference resolution, Match Width or Height, Match to 0
    3. Done