Hi all,

I have a camera and it is positioned at (0,0,0). I want to move the camera backwards such that the function Camera.main.ViewportToWorldPoint( new Vector3( 1, 0.5, Camera.main.transform.position.z ) ) will return “almost” exactly 10. In other words, camera’s horizontal field of view will be 20-unit wide at the plane Z=0.

I gave this short script to the camera:

```
function Start()
{
transform.position.z -= 10 / Mathf.Tan( Mathf.Deg2Rad * camera.fieldOfView * camera.aspect * 0.5f );
}
function Update()
{
print( camera.ViewportToWorldPoint( new Vector3( 1, 0.5, -transform.position.z ) ) );
}
```

It prints 8.5 to the console. My math is not very good but I really expected some value very close to 10. Can someone help me solve my problem?

Thank you