Skip to main content
Participant
July 30, 2013

OVRCameraController.cs - UnityEngine.Camera.fov is obsolete

Hi,

The following warning is displayed in Unity v4.2.0f4 when running the Oculus Tuscany Demo Project (OculusUnityIntegrationTuscanyDemo.unitypackage) found in SDK v0.2.3 :-

Assets/OVR/Scripts/OVRCameraController.cs(207,24): warning CS0618: `UnityEngine.Camera.fov' is obsolete: `use Camera.fieldOfView instead.'

Obviously it's a trivial issue at the moment, but it might be worth updating it before your next SDK release.

Cheers,
Mark
    This topic has been closed for replies.

    4 replies

    Up and Coming
    July 31, 2013
    Yeah, there's work that needs to be done on the Unity integration kit.
    An example of unoptimized code:
    gameObject.camera.transform.Rotate(...)

    You can actually access the same transform by just calling
    transform.Rotate(...)

    Or even better, cache the transform in the awake method, and access the cached reference:

    private Transform myTransform;
    void Awake()
    {
    myTransform = GetComponent<Transform>();
    }
    void Update()
    {
    myTransform.Rotate(...)
    }
    New Participant
    August 5, 2013
    i know little to nothing about code, so ill bite the bullet ans ask are these solutions to the error if so could you show me where int the code for the overcameracontroller.cs i need to implement these changes. sorry for not understanding the code. and thanks for any help and advice.
    Up and Coming
    August 5, 2013
    They aren't errors, just warnings. This means that you could likely do nothing and be fine for the next few versions of unity.

    If you'd like to manually do something about them, the warnings should show up in your console. Simply double clicking the warning will open the script and take you to the line.
    New Participant
    August 6, 2013
    ahh ok thanks for the quick response, if its not necessary to fix then i will leave it to the developers capable hands to address the error so i dont mess it all up.