Skip to main content
New Participant
November 12, 2014

Zooming in

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?
    This topic has been closed for replies.

    3 replies

    Inspiring
    November 12, 2014
    Is it not just:

    ovrRig.transform.position
    AMD Ryzen 7 1800X | MSI X370 Titanium | G.Skill 16GB DDR4 3200 | EVGA SuperNOVA 1000 | Corsair Hydro H110i Gigabyte RX Vega 64 x2 | Samsung 960 Evo M.2 500GB | Seagate FireCuda SSHD 2TB | Phanteks ENTHOO EVOLV
    New Participant
    November 12, 2014
    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.
    Up and Coming
    November 13, 2014
    "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.
    Scott Vandonkelaar Zero Latency - Inversion VR