Search Unity

  1. Welcome to the Unity Forums! Please take the time to read our Code of Conduct to familiarize yourself with the forum rules and how to post constructively.
  2. We have updated the language to the Editor Terms based on feedback from our employees and community. Learn more.
    Dismiss Notice
  3. Join us on November 16th, 2023, between 1 pm and 9 pm CET for Ask the Experts Online on Discord and on Unity Discussions.
    Dismiss Notice

Help getting VR cam to follow character in Unity 5

Discussion in 'AR/VR (XR) Discussion' started by DBoxVR, Aug 11, 2015.

  1. DBoxVR

    DBoxVR

    Joined:
    Jul 14, 2014
    Posts:
    15
    New-ish to Unity here, apologies if the question is asking too much. I have a simple script that works very well in non-VR mode, but as soon as I tick the VR enabled box it puts the camera in the right start position, but no longer follows my character. If I recall correctly, it worked when using the OVR camera in Unity 4.

    Here is the code. It's about as simple as codes get. Not sure why it says it's in CSharp. It isn't.

    Code (csharp):
    1.  
    2. var target : Transform;
    3. var distance = 10;
    4. var lift = 1.5;
    5.  
    6. function Update () {
    7.     transform.position = target.position + Vector3 (0, lift, distance);
    8. }
    9.  
     
  2. fabian1986

    fabian1986

    Joined:
    Jun 3, 2015
    Posts:
    33
    Hi man,

    I understand your question but try embebed the player for a game virtual reality.

    Search option player and embebed the player for VR


    give me the answer of the troubleshootiong.

    God bless you and I hope the boses of Unity give me congratulations for try answer the peolple
     
  3. fabian1986

    fabian1986

    Joined:
    Jun 3, 2015
    Posts:
    33
    checked the code and is JS
     
  4. EdBlais

    EdBlais

    Unity Technologies

    Joined:
    Nov 18, 2013
    Posts:
    303
    Create an empty game object and make the Camera a child of the empty object. Then change the transform of the Parent object (empty object). VR Camera transforms cannot be changed in the current integration of Unity. But the transform is effected by the parent object's transform.