- Home /
Recentering view/position with Oculus Rift DK2 in Unity 5?
Hi there. Quick question;
I'm trying to get recenter/repositioning functionality into Unity 5 for Oculus Rift DK2. What script do I need for this exactly? I'd like it to apply it on the start of an application and be able to do it via keystroke afterwards.
Forgive my ignorance, I have not been able to find the answer. Thank you in advance.
dk1...not sure if it's the same?
if (Input.Get$$anonymous$$eyDown("left ctrl"))
{
display.RecenterPose();
}
Answer by PumaOfDarkness · Nov 08, 2015 at 06:30 AM
Oh, actually, I figured it out myself. Thanks for your reply, though!
The exact script was;
using UnityEngine;
using System.Collections;
using UnityEngine.VR;
public class Example : MonoBehaviour {
void Start () {
UnityEngine.VR.InputTracking.Recenter();
}
void Update () {
if (Input.GetKey(KeyCode.F12))
{
UnityEngine.VR.InputTracking.Recenter();
}
}
}
Your answer
Follow this Question
Related Questions
Syncing object's coordinate position with object's animation position. 3 Answers
After Destroy clone, Spawn a prefab in its location? 1 Answer
Instantiating Multiple Game Objects to the Position of a Current GameObject 2 Answers
How do i move a GameObject to the same height as another GameObject? 0 Answers
Child Transform Problem 0 Answers