- Home /
Question by
MarkusKarlsson · Oct 10, 2016 at 07:12 AM ·
vrsamsungrotation detection
Samsung Gear VR headtracking to rotate player
I'm trying to rotate my player on y-axis according to users head rotation. The closest method I could find is this piece of code:
public class playerController : MonoBehaviour {
void Update () {
transform.eulerAngles = UnityEngine.VR.InputTracking.GetLocalRotation (UnityEngine.VR.VRNode.CenterEye).eulerAngles;
}
}
However this seems to rotate player only half of the head rotation. So if user rotates his head 90 degrees the player object rotates approximately 45 degrees. How can I do this properly?
Comment
Answer by user23 · Apr 28, 2017 at 01:48 PM
From another post on this very forum
Update()
{
Quaternion angles = InputTracking.GetLocalRotation(VRNode.Head);
transform.rotation = Quaternion.Euler(0, angles.eulerAngles.y, 0);
}
Your answer
Follow this Question
Related Questions
Unity on Gear VR with Galaxy S6 2 Answers
Is Build and Run essential to make a Gear VR app ? 1 Answer
Gear VR UI Input 1 Answer
Getting Gear VR to work 1 Answer
anybody working on gear vr oculus ? 0 Answers