cancel
Showing results for 
Search instead for 
Did you mean: 

Zooming in

mattgraham
Honored Guest
I am using 0.4.3 and was originally trying to zoom in using FOV of the left/right cameras. I have since changed the implementation to translating the whole OVRCameraRig.

Here is the current line of code I am using to move the camera: ovrRig.transform.Translate(new Vector3(0, 0 , 0.1f));

This translation will occur while a key is held down. I would like to stop it at a specific Z valuie, lets say 2.0.

Does anyone know how to access the current coordinates of the OVRCameraRig?
3 REPLIES 3

cybereality
Grand Champion
Is it not just:

ovrRig.transform.position

mattgraham
Honored Guest
I am making a simple project where I am just rotating an object and be able to zoom in/out (along the z-axis in 0.2f increments per update). Wrapping the OVRCameraRig in a GameObject and then using the function mentioned above seems to do the trick.

I just need to set bounds on the zooming. This is where I need to get the camera position, so I can make sure it hasn't moved past that boundary.

diablosv21
Honored Guest
"mattgraham" wrote:
I am making a simple project where I am just rotating an object and be able to zoom in/out (along the z-axis in 0.2f increments per update). Wrapping the OVRCameraRig in a GameObject and then using the function mentioned above seems to do the trick.

I just need to set bounds on the zooming. This is where I need to get the camera position, so I can make sure it hasn't moved past that boundary.

I think you are looking for the localPosition property. This will give the position of a transform relative to it's parent.