The offset does not work

Hi, No matter what value of offset i put in the code, my camera stays at the same place (if I put a +ve value, the screen goes green). Why is this not working?

Hi braga,

Please share more information on what you did and have in Unity. Screenshots might also be helpful.

And what do you mean by “offset”? What exactly would you you want to achieve? I’m asking because an orthographic camera does not have any depth. The things in front of the camera get rendered with the same size, no matter how far away they are.

Hi!

currently, my camera is following the car but is too close to it. I want to move it further away from the screen.
I followed the tutorial video, and they added an offset (0,0,-10) to move the camera away from the screen. But no matter what value I put in the z coordinate, the camera stays in the same place.

I think I understood your point as to why the camera is not zooming in or moving away from the game screen. So what if I want to zoom back a bit? how do I do that? (uploaded images for your reference)


That’s what I meant. The distance to the game object won’t affect the “zoom”. The reason why you set the camera to z = -10 is that the other game objects are supposed to be in front of the camera, not inside or behind it.

To make the camera viewport larger or smaller, change the size value in the Camera component. Since this value does not affect the car or anything else in the game, you may adjust it as you wish.


See also:

This topic was automatically closed 24 hours after the last reply. New replies are no longer allowed.