Search Unity

  1. Megacity Metro Demo now available. Download now.
    Dismiss Notice
  2. Unity support for visionOS is now available. Learn more in our blog post.
    Dismiss Notice

How to set camera to a fixed aspect ratio then stretch to match the screen?

Discussion in '2D' started by aflesher, Jan 31, 2018.

  1. aflesher

    aflesher

    Joined:
    Dec 12, 2013
    Posts:
    28
    My main camera is orthographic and has a script attached to it that forces it to a 16 x 9 aspect ratio.

    The side effect of this is that screens that are a different aspect ratio see black bars on the top and bottom or sides. For players with non 16 x 9 screens I would like to give them the option between letterbox and stretch to fit.

    My question is how can I capture at 16 x 9 and then stretch the image to match the screens aspect ratio?