Forum Discussion
jcapela
9 years agoHonored Guest
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?
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
- jcapelaHonored GuestI 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.
- juanoldinhoHeroic ExplorerWould you mind posting the FixedUpdate() code in your PlayerControllers.cs.
Also how are you trying to control the ball? - jcapelaHonored GuestI'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);
}
----- - juanoldinhoHeroic ExplorerA 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)? - jcapelaHonored Guesthere is a screenshot of my player settings. I tried to attach PlayerController.cs but apparently the file type is not supported for upload.
- jcapelaHonored GuestOK, 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.
- juanoldinhoHeroic ExplorerThat'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.
Quick Links
- Horizon Developer Support
- Quest User Forums
- Troubleshooting Forum for problems with a game or app
- Quest Support for problems with your device
Other Meta Support
Related Content
- 3 years ago
- 2 months ago
- 8 months ago
- 12 years ago
- 6 months ago