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

Unity Oculus: Character not movie in direction of camera

Discussion in 'AR/VR (XR) Discussion' started by fredyyanez, May 27, 2015.

  1. fredyyanez

    fredyyanez

    Joined:
    Jul 8, 2014
    Posts:
    33
    moving***
    Im trying to make a character navigate through a set space. I have created a character ( capsule) and I have added the FirstPersonControl.cs file to it to control the character. I know that this file should account for the camera direction i.e.
    Code (CSharp):
    1.  // always move along the camera forward as it is the direction that it being aimed at
    2. Vector3 desiredMove = transform.forward*m_Input.y + transform.right*m_Input.x;
    But I don't think it has the oculus camera in reference i.e.
    Code (CSharp):
    1. private Camera m_Camera;
    2. m_Camera = Camera.main;
    So m_Camera is not the "oculus camera".

    I have also added the OVRCamara to the capsule. How can I pair this OVR camera to the camera being referenced in the FirstPersonControl.cs file ?

    Thanks,

    Fredy
     
  2. ThomasCreate

    ThomasCreate

    Joined:
    Feb 23, 2015
    Posts:
    81
    Is one of the cameras in the OVRCamera instance tagged as MainCamera?