c# multiple camera help

Hi There,

I have setup a simulation, of which it is just running continuously. I have setup some different points of view with cameras all capturing the same thing from different spots. I have used the viewport rectangles of each camera to form a perimeter around the bottom and right side of my screen. The left side and top side of the screen, I would like to have it also be a camera which serves as the “main”, enlarged view. When the user clicks on one of the smaller camera view points, it switches the “main” big camera over to this view point.

I have setup UI buttons over each camera to allow the click functionality, but am having trouble scripting the code to make this happen. All of the camera switching code examples I’ve seen, work by enabling or disabling cameras, but if I do this, it would also disable my small viewport cameras (deal-breaker). Any ideas?

I think you can do something like updating the rectangles of the cameras. E.g.

Cameras[0].rect = new Rect(0f, 0f, 0.5f, 1f);

This probably is what you want.