From the course: Unity: Building VR User Interfaces

Publishing to the Quest - Unity Tutorial

From the course: Unity: Building VR User Interfaces

Start my 1-month free trial

Publishing to the Quest

- [Instructor] The crux of this course is to view UI in VR. And to do that, we need to be able to get our experiments onto our Oculus Quest device. To start our journey of deployment, please navigate over to developer.oculus.com forward slash documentation forward slash unity forward slash book dash unity dash GSG. When you get to this page, let's navigate halfway down to where it says set up the Oculus device. So the first step that we need to do in order to deploy to the device is to set up the Oculus Companion app. Please follow steps one through four under set up Oculus device. This will instruct you where to get the companion app and how to set it up on your particular phone. Once you've got your companion app all set up, please navigate over to enable device for development and testing. We're going to be connecting to our Oculus Quest headset via USB. So we're going to follow some of the instructions under connect device via USB. We're going to go through instructions one through four. What this is going to do is allow us to set the developer mode, which would allow us to actually push an APK to the device. First thing we're going to do on the Oculus Companion app is go to settings. In settings, you'll see your device listed there, tap on it, and you'll see more options appear. In these more options, you'll see more settings. Tap on that and you'll see an option for the developer mode. Tap on that. It's going to be a toggle, so make sure that this toggle is toggled to active. Lastly, please make sure that your device is connected to your computer via the USB-C cable that hopefully came with a device. What I find also helps is to make sure that your Oculus Quest device is on exactly the same wifi network as your computer. Now that we've got our device linked to our computer, it's time to publish. Let's go back to Unity. So compiling and publishing to device takes time. We want to cut this time down as much as possible so here's one trick that we're going to use. Navigate over to the OVR player controller, game object, expand that, navigate it over to OVR camera rig and we're going to change some settings in the OVR manager. Scroll down to the bottom of the OVR manager and you'll see a setting here that says skip unneeded shaders. We're definitely going to want that. Let's click that on. And while we're here, let's go up to the top and uncheck use recommended MSAA settings. This is multi sample anti-aliasing and because we want a good baseline, like we set for the render scale, we want to make sure that that is set off. All right, everything in our project is ready to push. Let's go over to file and build settings. Make sure that your scene is included in the scenes to build, and also make sure that your build target is set to Android. If you've opened up this project directly from the example files without following along, this might be set to PC Mac Linux. Please follow the steps in the second video of this chapter in order to learn how to switch platform. Now under the settings here, we want to make sure that the development build is checked and we're going to go and select our Oculus Quest from this device list. Here, you can see my Oculus Quest device. If the Oculus Quest device does not show up in this list, please hit refresh. If that doesn't help, I often find that to closing Unity and opening it up again will definitely expose the device. Once you have the device selected in run device, we're going to go ahead, build and run. This is going to give us a dialogue of where we want to save our APK. I'm going to want to save this in a folder called builds on my desktop. We take a look here, I've got a folder called builds and inside builds, I'm going to save this as VRUI. That's going to be the name of the APK. So once I have VRUI set there, I'm going to hit save. Now, this is going to kick off the process of compiling and building for the Oculus Quest. Once it's done compiling and building, it'll automatically push it to the device and you can view the experience. So at this point, we should have the application running on our Oculus Quest device. Let's go take a look, shall we? Here we are in VR. If your application did not stop by default or you would like to relaunch your application from VR, that's no worries. Just hit the Oculus button on the right-hand controller and that will bring up the main menu. Here in our main menu bar, I'm on the applications section and here in my application section all the way on the right hand, I have unknown sources selected. So make sure that you scroll down here, hit unknown sources, and you'll be presented with this panel. Now our application VRUI sitting right at the top, and it's got the bundle ID of com dot default company dot VR UI. To launch it, just click on it. And here we are in VR. I still love coming into VR even if it's a half empty scene, but in front of us, you can see that we've got our controllers perfectly implemented and we've got a ground plane as well as the ball that tells us which direction is forward. Now that we know that we can publish something to VR, it's time to add a little more.

Contents