05-21-2018 10:31 PM
02-10-2019 11:35 AM
03-03-2019 05:05 AM
public class PlayerMove : MonoBehaviour
{
public float moveSpeed = 10.0f;
public GameObject cameraRig;
public GameObject centerEye;
private Vector2 touchpad;
void Update()
{
//Player movement
touchpad = OVRInput.Get(OVRInput.Axis2D.PrimaryTouchpad);
transform.eulerAngles = new Vector3(0, centerEye.transform.localEulerAngles.y, 0);
transform.Translate(Vector3.forward * moveSpeed * touchpad.y * Time.deltaTime);
transform.Translate(Vector3.right * moveSpeed * touchpad.x * Time.deltaTime);
cameraRig.transform.position = transform.position;
}
}
I used the CameraRig. Make sure to drag the camera rig and center eye objects into the slots in the inspector. 07-01-2019 09:05 AM
07-04-2019 04:47 AM