- Home /
Set skateboard (gameobject) to rotate with OVR camera
I have a skateboard (gameobject) that stands still when I look around with the oculus rift's OVRCameraController.
It does follow around, but it just stands there facing north instead of heading where the player is looking.
Please help D:
-jank
Answer by Jank · Apr 20, 2014 at 08:53 PM
nevermind i figured myself var dir : Vector3; dir = Camera.main.transform.forward; // forward // dir = -Camera.main.transform.forward; // back // dir = Camera.main.transform.right; // right; // dir = -Camera.main.transsform.left; // left;
dir.y = transform.position.y dir.Normalize(); transform.Translate(dir speed Time.deltaTime);
Your answer
Follow this Question
Related Questions
How can integrate Oculus camera script in unity project? 0 Answers
Override Oculus Orientation 5.3 1 Answer
Sprite facing multiple cameras? 1 Answer
Setting Main Camera Rotation 3 Answers
Problem with the rotation of camera in third person 1 Answer