- Home /
Having Issues with Camera Viewport Rect
I am currently working on a multiplayer game that requires splitscreen. I have looked up how to change the camera's viewport rect in order to acheive this, however, whenever I change the x or y values off of 0, it doesn't work. As expected, when I change the values to less than 0 or higher than 1, it stops working. That is not the problem.
I want one camera to take up the upper half of the screen and the other to take up the lower half. So I think it makes sense to set one camera's viewport's y value to 0.5 and leave the other at 0. I would leave the x and width values at 0 and 1 respectively and change the height value to 0.5. However, when I do this, all that happens is that both cameras take up the lower half of the screen. No matter what I set the y value to, it never moves the camera view's position in the screen unless I set it to a value that Unity doesn't like and it shrinks away my view or sets it to the scene view camera.
I can change the size of the screen that the camera takes up but not where on the screen that space is.
Any help is appreciated.
Your answer
Follow this Question
Related Questions
Changing the Camera viewport rect results in resizing the objects rendered by the specific camera ? 1 Answer
ViewportToWorldPoint with multiple cameras 0 Answers
Translate GetWorldCorners (new UI) to Viewport for a camera rect 1 Answer
How does the aspect ratio work? 0 Answers
How to make a split screen in HDRP ? 1 Answer