Hey guys, I’ve scoured the forums for this little topic and came up shorthanded. Also, I’ve explored Unity’s extensive documentation but alas, no answer is to be found (or I just didn’t see it).
In any event, my situation is this: I have two cameras both enabled at once.
Camera1 has depth of 0
Camera2 has depth of 1
Camera2’s normalized viewport rectangle values are x=0.8 and y=0.8. In other words, I have camera2 rendering in a smaller area on top of camera1.
My question is this: Can you change those normalized viewport rectangle values through scripting, and if so, how?
I’m trying to achieve an effect where you’re aiming a projectile and camera1 is an up-close view and camera2 is a further back view, and when the player clicks on an invisible GUIButton in the same location on the screen as the “picture-in-picture” camera2, then camera1 has its normalized viewport rectangle values swapped with camera2’s.
This would have the effect of alternating far back or close up views by clicking or in iPhone’s case, tapping on the smaller camera view on top of the other larger camera view.
I’ve tried lots of things but I can’t find out how to access and change normalized rectangle viewports through a script attached to another object (the projectile).
Any thoughts? Or silver bullets? Any caliber will do. Thanks.