Forum Discussion

🚨 This forum is archived and read-only. To submit a forum post, please visit our new Developer Forum. 🚨
panmaster's avatar
panmaster
Expert Protege
10 years ago

Unity 5.3 how recenter camera VR

Hi, a simple question
How to recetner normal VR camera in Unity 5.3?

I am starting with, but gives an error

using UnityEngine;
using System.Collections;
using VR= UnityEngine.VR;
public class recenter : MonoBehaviour {

// Use this for initialization
void Start () {

}

// Update is called once per frame
void Update () {
if (Input.GetKeyDown (KeyCode.R)) {
VR.InputTracking.Recenter ();
}
}
}

2 Replies

Replies have been turned off for this discussion
  • What does the error message say?

    Also, I believe you can just call it like this:


    using UnityEngine.VR;
    ...
    InputTracking.Recenter()
  • panmaster's avatar
    panmaster
    Expert Protege
    "cybereality" wrote:
    What does the error message say?

    Also, I believe you can just call it like this:


    using UnityEngine.VR;
    ...
    InputTracking.Recenter()



    OK this works,thx!