Forum Discussion

🚨 This forum is archived and read-only. To submit a forum post, please visit our new Developer Forum. 🚨
jcapela's avatar
jcapela
Honored Guest
9 years ago

I can't get the player to move in the roll-a-ball VR tutorial

I finished the Unity tutorial for Roll-a-Ball (https://unity3d.com/learn/tutorials/projects/roll-ball-tutorial), then continued with the Oculus tutorial 'Build a Simple VR Unity Game' (https://developer3.oculus.com/documentation/game-engines/latest/concepts/unity-build/#unity-build).

However, I cannot get the player (ball) to move. Any clues? I am as new to this as can be, so I'm thinking it might be something pretty obvious.

I am able to configure the project where the camera is not a child of the player, and there is no player constraint to freeze rotation - build and gameplay work fine, just the camera doesn't move. How do I get both the ball to move and the camera to move with it?

7 Replies

Replies have been turned off for this discussion
  • jcapela's avatar
    jcapela
    Honored Guest
    I believe the unity thread refers to folks who can't get the ball to move in the original unity tutorial. i'm able to complete the unity tutorial just fine; everything builds and plays as expected. my problems start when I try to make the roll-a-ball game work in VR with the steps in the oculus tutorial.
  • juanoldinho's avatar
    juanoldinho
    Heroic Explorer
    Would you mind posting the FixedUpdate() code in your PlayerControllers.cs. 

    Also how are you trying to control the ball?
  • jcapela's avatar
    jcapela
    Honored Guest
    I've tried moving the ball via keyboard arrow keys and via asdw keys (these work fine on the pre-VR build) as well as xbox controller joysticks. 

    my FixedUpdate() below.
    -----


        void FixedUpdate ()

        {

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

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



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



            rb.AddForce (movement * speed);

        }


    -----

  • juanoldinho's avatar
    juanoldinho
    Heroic Explorer
    A couple things. 

    Have you enabled Virtual Reality Support in the Project Settings -> Player -> Other Settings
    Are you using the Play mode in the Unity Editor to test your app? 
    Can you post a screenshot of the Inspector Panel (with Player object selected)?
  • jcapela's avatar
    jcapela
    Honored Guest
    here is a screenshot of my player settings. I tried to attach PlayerController.cs but apparently the file type is not supported for upload.

  • jcapela's avatar
    jcapela
    Honored Guest
    OK, so I've rebuilt the original unity tutorial from scratch and I am able to follow the oculus tutorial steps to make it work in VR. i'll chalk up my previous effort's failure to user error. i'm still not sure how I was able to have a working version before the VR steps that failed afterwards; i'll chalk that up to voodoo. thanks, everyone, for your help.
  • juanoldinho's avatar
    juanoldinho
    Heroic Explorer
    That's good to hear.

    If you can remember any differences between your first and second try that may help others or want to suggest improvements to the documentation that would be great.