Search Unity

Problem with camera in VR

Discussion in 'AR/VR (XR) Discussion' started by vincentgravitas, Jun 10, 2018.

  1. vincentgravitas

    vincentgravitas

    Joined:
    Jan 25, 2015
    Posts:
    6
    I need to be able to change the FOV of a camera at runtime, and this camera is not rendering to the eye targets. The camera's target eye property is set to "None (Main Display)" in the editor. However, I am encountering this error when I try to modify this non-VR camera:


    Cannot set field of view on camera with name 'Camera (main display)' while VR is enabled.
    UnityEngine.Camera:set_fieldOfView(Camera, Single)


    Why is changing the FOV forbidden for all cameras, just because one camera is in VR mode? Is this a bug?

    P.S.: I should note that it is still possible to use Camera.CopyFrom() to modify the camera FOV when in VR mode.
     
    Last edited: Jun 10, 2018
  2. Kideokk

    Kideokk

    Joined:
    Jan 18, 2018
    Posts:
    31
    hmm.. first, i don't know it is helpful.
    i tried modify VR camera FOV, so finding how to change VR Camera FOV Value.
    i'm using MRTK(Mixed Reality Tool Kit) , and 'using Holotoolkit.input.XR;'
    - XRDevice.fovZoomfactor <- changing VR camera fov .
    ex) XRDevice.fovZoomfactor = 2; <- scope 2x
    I hope that it is helpful for you.
     
    ROBYER1 likes this.