cancel
Showing results for 
Search instead for 
Did you mean: 

Controller Support

mhenrydpai
Honored Guest
I was able to develop a Unity game and Build and Run it on my Oculus Go. The scene is there, a plane, 2 cubes and a sphere, however, I cannot get the player to move using my controller. I was thinking the controller would simulate the input from the arrow keys that are used in Unity. How can I make this connection?
3 REPLIES 3

BigDaddio
Protege
there are examples scenes in the Oculus folder in Assets. Assets>Oculus>SampleFramework>Usage.
It also sounds like you do not understand Unity Input or have read about OVRInput. The simplest thing to do is use Unity Input to read the touchpad as Horizontal and Vertical.

mhenrydpai
Honored Guest

I do not see the Oculus folder under Assets.

This code allows me to use the arrow keys on my computer keyboard in Unity to move my player object, however, if I do a build an run to Oculus Go it does not work using the controller:

public class PlayerController : MonoBehaviour
{
    public float speed;

    private Rigidbody rb;

    private 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

Anonymous
Not applicable
Yeah as @BigDaddio said, the OVRinput handles a conversion between the standard controller and the one's built for VR.  The script basically remaps a standard controller to the touchpad and other features of oculus go.  Include that script with your things, look for oculus tool download if you dont have it in the android SDK.