Search Unity

how to change the angle of Oculus in Unity ?

Discussion in 'AR/VR (XR) Discussion' started by unity_79O2j-p-2q70Hg, Oct 9, 2017.

  1. unity_79O2j-p-2q70Hg

    unity_79O2j-p-2q70Hg

    Joined:
    Oct 9, 2017
    Posts:
    1
    I would like to change the CameraView in Unity program.
    what exactly has to be done , and which steps?
    and what do you have to adjust in Unity to edit the angle? otherwise, if you should to add scripts ... what is the content?
    this will be certainly very helpful.
    thanks

    Khalil Rais
     
  2. AnimeTed

    AnimeTed

    Joined:
    Sep 29, 2016
    Posts:
    2
    Can't give you step by step how to as I'm just passing by while looking for another issue, but I might be able to give you the missing piece to get it working the way I think your for.

    When you play a scene from a VR camera, it resets rotation and position to zero on all axis and then uses the position tracking to enter in and change the values, so if you try to rotate the angle of the VR camera, which is what I think you mean by angle, the changed values are lost.

    In that case what you have to do is make the camera a child object of a blank gameobject in the hierarchy. Then you can change the angle of the parent object and that will set your default location for the VR camera. Just make sure when your changing position and rotation that the child object, the camera itself, stays at 0,0,0 position and rotation.
     
  3. MadeFromPolygons

    MadeFromPolygons

    Joined:
    Oct 5, 2013
    Posts:
    3,983
    You move it the same way you move any other gameobject / transform?

    Just on start use a reference to that transform and move it to where you want to be?
    transform.position += offset.position; or something.