- Home /
Brand new to Unity, trying to grasp some basic stuff related to cameras and angles
Just started learning Unity yesterday, coming from a development/design background, and I'm having problems understanding something that should be very basic. Please bear with me here.
I've made a scene with two cameras. I've made both cameras follow an object using an edited version of the SmoothFollow script. And have changed their Normalized View Point Rects so that one shows on the left side of the screen, and the other one on the right.
Now I want these cameras to point in separate directions, each one capturing a 90° viewing angle, and together capturing a 180° view. Why use two cameras instead of just one? Well I want to project each of these onto a corner in a room, and thereby creating a window on both walls going out into the generated world.
My initial reaction was, well, let's offset one camera by -45°, and the other by 45°, and set their viewing angles to 90°. In my head that means that they'll together capture a 180° viewing angle with the center being straight in front of my object. But apparently my reasoning here is faulty. What I ended up having to do was set the viewing angle to 115° to get them to cover 180° together and not overlap. And it seemed to work perfectly… Until…
I resized the scene view.
…
Suddenly the previous angles didn't work anymore. Now what I can't grasp is why would resizing the scene view, or moving my viewing angle on the scene view up or down affect what these cameras can see? If I position my view (not the object or any of the cameras) correctly, and set the right width of the scene view, then it works perfectly, but if I try to resize it in any way it affects the game view.
Example where my cameras are aligned up (well, almost, can see them diverging a bit):
Example where I resized the scene view slightly and they no longer line up:
So what is going on here? What am I misunderstanding? And how can I get these two cameras to behave in the way I want?
Answer by cjdev · Apr 19, 2013 at 06:03 PM
I think the problem is that when you resize the scene view you are also changing the game view which is changing the target resolution. The cameras are adjusting to the new resolution accordingly.