- Home /
Moving Camera/Player in VR using OVR Raycaster?
Hey there, I'm really new in this whole scripting world, but I must use unity for this VR project, and now I'm stuck.
I'm using this project as a guide/base and changed some elements since l need to keep the whole OVRGazePointer and Camera Rig: https://developer3.oculus.com/blog/unitys-ui-system-in-vr/
But now instead of moving sliders and levers I just want to click on an object in a certain distance (shown as a particle system) with the GazePointerRig and make the Camera Rig into that position so the user can move and explore this VR world.
I'm less than a newbie in Unity as well as C#, o if anyone can help me with the code for it, that'd be awesome.
I also found this other code thinking it would help, but honestly I don't have a single idea of how to adapt it so l use the GazePointer instead of the mouse:
using UnityEngine; using System.Collections;
public class targetmove : MonoBehaviour {
// Use this for initialization
void Start () {
Vector3 newPosition = transform.position;
}
// Update is called once per frame
void Update () {
if (Input.GetKeyDown(KeyCode.Mouse0))
{
if (Input.GetMouseButtonDown(0))
{
newPosition.x = Input.mousePosition.x;
newPosition.y = Input.mousePosition.y;
transform.position = newPosition;
}
}
}
I'm using a MacBook OS10.11 and Unity 5.4
Again l hope someone can help me with a script sample for this, since I need support ASAP. Thanks very much.
Your answer
Follow this Question
Related Questions
How to stop a video using the OCULUS script MoviePlayerSample.CS. 0 Answers
How to save time left in my victory scene 0 Answers
Saving JSON file in Android,How to save json file in android 0 Answers
Can handheld.PlayfullScreenMovie() work with Vr view to play 360 degree video using google vr sdk? 0 Answers
Sending information from android game to android app via Bluetooth/Wifi-Direct 0 Answers