1
votes

I am new to Unity / Oculus Go. I followed the Unity tutorial for the roll a ball game which works on the computer. I add the OVRCameraRig and install it to the Oculus Go and can see the game but cannot move using the touchpad.

https://developer.oculus.com/documentation/unity/latest/concepts/unity-integration-tutorial-rollaball-intro/

https://unity3d.com/learn/tutorials/s/roll-ball-tutorial

I know for the tutorial it says regular InputManager and the below code should work for VR. InputManager detects movement in the X and Y axis from keys or joysticks, but the Oculus Go doesn't have a joystick - so maybe InputManager doesn't support Go?

I know there is an OVRInput in Oculus Utilities but can't figure out how to make it move the player object. Any advice or articles I can refer to?

using UnityEngine; using System.Collections;

public class PlayerController : MonoBehaviour {

public float speed;

private Rigidbody rb;

void Start ()
{
    rb = GetComponent<Rigidbody>();
}

void FixedUpdate ()
{
    float moveHorizontal = Input.GetAxis ("Horizontal");
    float moveVertical = Input.GetAxis ("Vertical");

    Vector3 movement = new Vector3 (moveHorizontal, 0.0f, moveVertical);

    rb.AddForce (movement * speed);
}

}

Thanks!

1

1 Answers

0
votes

Yes the easiest and most "native" way is to use OVRInput which comes with the Oculus SDK for Unity3d. You can watch "Roll a ball" tutorial for PC to see how they use keyboard arrows to add force to the ball and then you can just replace it with OVRInput. These series of tutorials are awesome. Good luck.