Forum Discussion
mattgraham
11 years agoHonored Guest
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?
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
Replies have been turned off for this discussion
- cyberealityGrand ChampionIs it not just:
ovrRig.transform.position
- mattgrahamHonored GuestI 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. - diablosv21Honored 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.
Quick Links
- Horizon Developer Support
- Quest User Forums
- Troubleshooting Forum for problems with a game or app
- Quest Support for problems with your device
Other Meta Support
Related Content
- 1 year ago
- 11 years ago