camera.pixelrect not behaving properly

The following code

Camera.mainCamera.pixelRect = new Rect(0.5f,0,1,1);

Causes the pixelrect to be changed to x: 0.0004878049, y: 0, w: 0.0009756098, h: 0.001371742

Why do the actual values not match the programmed values?

Hello there, instead of using “pixelRect” try with “rect”, any doubt check the manual.

Turns out that I was trying to set it as a Normalized like it is shown in the inspector. However when you set it through pixelrect it should not be normalized.

Probably i faced similar problem, i updated pixelRect for one of my camera, but new value didn’t change actual pixel rect of camera.
before call camera i waited for end of frame. then i changed endOfFrame to waitForSecond(0.000001) (next frame) and new rect applied properly.