Search Unity

Moving the camera

Discussion in 'Daydream' started by SecretImbecile, Oct 24, 2016.

  1. SecretImbecile

    SecretImbecile

    Joined:
    Mar 9, 2014
    Posts:
    2
    Hi,

    I'm using the Technical preview (9), and attempting to move the camera position via script. It works as intended in the desktop editor, but not in game. How can I move the VR camera?

    I'm using the VR camera created by adding VR support to the player settings, not the VR SDK prefab of old.

    EDIT: Have tried with a GVRViewer prefab attached to camera, same result.

    Thanks
     
    Last edited: Oct 24, 2016
  2. Tuitive

    Tuitive

    Joined:
    Mar 25, 2013
    Posts:
    36
    Attach the camera to a parent game object and then move that parent game object, not the camera. You shouldn't try to move or orient the camera directly in VR.
     
    glenneroo and SecretImbecile like this.
  3. SecretImbecile

    SecretImbecile

    Joined:
    Mar 9, 2014
    Posts:
    2
    Working correctly now, thanks
     
  4. BadGrandad

    BadGrandad

    Joined:
    Nov 8, 2016
    Posts:
    4
    DOH!!! I forgot this too! Thanks!
    For anybody else - What made me forget was that it was working in the editor quite happily! When I parented the camera it was working in both.

    Is this an editor bug? i.e. it shouldn't move the camera directly?
     
  5. Selzier

    Selzier

    Joined:
    Sep 23, 2014
    Posts:
    652
  6. bhlee

    bhlee

    Joined:
    Nov 16, 2016
    Posts:
    7
    FYI, I had a CharacterController component attached to the main Camera on prior Unity version and it did work before when I moved the CC. But this does not work with the Unity Preview version so had to move it to the parent object.