OCA
OCA

Reputation: 111

Resizing orthographic camera in Unity

I am working on a project in Unity 2D and I am new. I don't know how to resize the camera so it doesn't have a perfect square shape. I want a rectangular camera, how do I do it?

Upvotes: 3

Views: 8639

Answers (2)

thatOneGuy
thatOneGuy

Reputation: 10632

An old question, but may help someone :)

With regards to the difference between length and width of your camera, if you are using orthographic then there is an attribute called 'Viewport rect' where you can set the 'W' and 'H' which will change the scale of the width and height of your camera relative to each other.

So, for example, if you had W = 1 and H = 1, then you would get a square. If you had W = 5 and H = 5 you would get the same size square.

To get around this you, i.e. change the actual size of the camera, you need to edit the size attribute. This value actually changes the size of the camera view.

If you are using a perspective camera, instead of size, you would change the 'Field of view' setting underneath the 'Projection' setting.

Upvotes: 2

Stanislav Osipov
Stanislav Osipov

Reputation: 48

Try to describe what you are trying to achieve.

User will see world depends on device resolution, which is rectangular (1920 * 1080) for example.

Upvotes: 0

Related Questions