cancel
Showing results for 
Search instead for 
Did you mean: 

Roll a Ball for Oculus Go - Can't move the ball

chuimtang
Honored Guest
Hi,

I tried following the instructions for converting the Roll a Ball tutorial to VR. It works fine on the computer but I cannot move the ball in Oculus Go. On the computer, you can move it using the arrow keys. My guess is in Oculus it should move based on the swipes in the touchpad. I tried adding OVRInput as a component to the Player since it adds the swipe functionality but that doesn't do anything. Has anyone made this work for Oculus Go?

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

Here is the player controller:





using System.Collections;

using System.Collections.Generic;

using UnityEngine;

using UnityEngine.UI;



public class PlayerController : MonoBehaviour {



    public float speed;

    public Text countText;

    public Text winText;



    private Rigidbody rb;

    private int count;



    void Start ()

    {

        rb = GetComponent<Rigidbody>();

        count = 0;

        SetCountText ();

        winText.text = "";

    } 



    void FixedUpdate () 

    {

        float moveHorizontal = Input.GetAxis ("Horizontal");

        float moveVertical = Input.GetAxis ("Vertical");



        Vector3 movement = new Vector3 (moveHorizontal, 0, moveVertical);

        rb.AddForce (movement * speed);

    }



    void OnTriggerEnter(Collider other) {

        if (other.gameObject.CompareTag("Pick Up"))

            other.gameObject.SetActive(false);

            count++;

            SetCountText ();

    }



    void SetCountText() 

    {

        countText.text = "Count: " + count.ToString ();

        if (count >= 14) {

            winText.text = "You Win!";

        }

    }

}
 
0 REPLIES 0