2
\$\begingroup\$

While stretching camera bounds, changing width adds black offset while changing height stretches image.

How can I achieve opposite behavior and match the bounds to the width instead of height ?

Stretching width Original square Stretching height

\$\endgroup\$
  • 1
    \$\begingroup\$ Which ones of your pictures are showing the correct behaviour? I'm having trouble visualising what the problem is. \$\endgroup\$ – Anko May 16 '16 at 0:11
  • \$\begingroup\$ All of them are actual behavior. Look at the square picture, when I shrink the height on that one and get wide 16:9 image the content is zoomed out. I don't want that, I want the content the same size as is in square picture. On the other hand, I want the zoom out when I shrink the width of the square and get 9:16 image. So I want the complete opposite of what is happening right now. \$\endgroup\$ – jellyfication May 19 '16 at 2:36
1
\$\begingroup\$

Try changing the camera's orthographic size based on aspect ratio. The larger the orthographic size the farther out it will have "zoomed". For instance, if your camera's orthographic size is 10 normally, when you switch to 16:9 aspect ratio set the orthographic size to a smaller value.

Or for perspective camera you can try this

| improve this answer | |
\$\endgroup\$
  • \$\begingroup\$ I have a perspective camera though \$\endgroup\$ – jellyfication Jul 11 '16 at 22:02
  • 1
    \$\begingroup\$ Do you need the perspective? It looks like your game is 2D. If you need it then try this. \$\endgroup\$ – Wafer Jul 11 '16 at 22:27

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

Not the answer you're looking for? Browse other questions tagged or ask your own question.