Forum Discussion

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

After trying the Roll-a-ball tutorial.

Hey, Ive recently been doing a bit of training on Unity, and want to integrate it into oculus rift, I've seen the tutorials to use the Oculus plugin, which I've downlaoded off this website, and tried a few things:
1- Ive tried deleting the player and replacing it with the OVR player controller
2- I've also tried puting in the OVR player controller under the prexisting player that I created while doing the rollaball tutorial.

The problem is that when I do this, it either spins the camera around when I try to move the ball,
or it just seems to mess out.

Any insight on how I could integrate this plugin to the rollaball game (provided by the unity website)?

Cheers.

7 Replies

Replies have been turned off for this discussion
  • weasel47's avatar
    weasel47
    Heroic Explorer
    I don't know all the specifics of that project, but it sounds like you should leave the player in there, disable the camera, and put in the OVR camera rig. The OVR player controller is only for walking around in first-person.
  • Hey, thanks for the help, I tried as you said, and I think I'm missing some scripting here, I'm getting a NullReferenceException: Object reference not set to an instance of an object.. this is coz I havent linked the camera view to the player right? Could you please suggest me a script I could go for? In the main camera, I was using MonoBehavior for the pre-existing camera controller script, and linked the player to the player object, the ball.
    Thanks for helpin out a noob. Means a lot.
  • weasel47's avatar
    weasel47
    Heroic Explorer
    I'm not familiar with the project. What script is throwing that error? You should be able to double-click on the error to open the script and see what line is problematic.

    In the original version, does the camera move to follow the ball? That might not be comfortable in the Rift.
  • yea, I had the main camera follow around the player from above with 45 degrees tilt.
    I realized there was a version error as well, so now, if i disable the main camera and the player, and use OVR Playercontroller, I can roam around the game, but I'll have to apply the physics of the player to the OVR playercontroller. Do you think it'll be easier for me to just add the OVRcameraController to the pre-existing ball/player instead?
    Chur chur!
  • weasel47's avatar
    weasel47
    Heroic Explorer
    "ricefice" wrote:
    yea, I had the main camera follow around the player from above with 45 degrees tilt.
    I realized there was a version error as well, so now, if i disable the main camera and the player, and use OVR Playercontroller, I can roam around the game, but I'll have to apply the physics of the player to the OVR playercontroller. Do you think it'll be easier for me to just add the OVRcameraController to the pre-existing ball/player instead?
    Chur chur!


    Yes, as I said before, the OVR player controller is designed for walking around in 1st person. It wouldn't make sense for a game like this. You should disable the main camera (no need to delete it, just uncheck the checkbox in upper left corner of the inspector for it) and put the OVRCameraRig in the same place that the main camera is.
    I suspect your error "NullReferenceException: Object reference not set to an instance of an object" is related to the main camera. Look at the inspector for the ball and see if "main camera" is linked in one of the scripts. If it is, you can try putting the OVRCameraRig in there.
  • Hey thanks a lot. I just got it running. Hopefully I can be of some help to you in the future.
    ;)
  • weasel47's avatar
    weasel47
    Heroic Explorer
    "ricefice" wrote:
    Hey thanks a lot. I just got it running. Hopefully I can be of some help to you in the future.
    ;)


    I'm glad to hear that it worked!

    I've only been using Unity for a few months, after a long hiatus from development. I'm still learning a lot myself.