How to Make Oculus Quest 2 Games // Introduction to Unity VR Development

Video Statistics and Information

Video
Captions Word Cloud
Reddit Comments
Captions
i just recently got this beautiful oculus quest  over here and i'm gonna use it to make my own   game the first video i have on this channel is  how to make a vr game in 2021 and it's using the   oculus rift s which a decent amount of people have  but i just recently got the quest 2 and the setup   for that is a little bit different so i'm going to  remake that video and show you guys how to set up   to develop with the oculus quest 2. let's go first  thing we need to do is download unity if you don't   have that installed already you can just type in  unity download into google and this first link   will get you there we're gonna download unity  hub and then choose the version from that when   it first comes up you'll be greeted with this  little setup window right here go down to the   installs and if you don't have an install already  we're gonna click add and then choose the latest   long-term support version and that is the  recommended version that you can grab you can   go newer if you want but these are still being  developed on so my recommendation is always to   go with the latest long-term support version  so for this i'm using 2020.3.5 keep in mind   you can have multiple versions downloaded at the  same time so you can swap back and forth so i'm   just gonna download the 2021 version go hit next  and then if you're using the oculus quest 2 you   need to make sure you have android build support  checked because the oculus quest 2 is inherently   an android device if you want to build games to it  and actually run games on the quest 2 you'll have   to have android build support checked make sure  you agree to the terms and conditions hit continue   approve it on your computer and let that run for  forever once your version is installed it'll look   like this one over here and if you have the  android build support that'll show up in the   little android thing down here so if we want to  start a new project we're going to go over to   projects you can click on new here or if you have  multiple versions you can click this drop down   arrow and select which version you want to create  a new project for from here you can choose any   number of templates there's even a vr template but  i've found that it works better when i just start   with a from scratch universal render pipeline or  3d template and then build up from there i found   that the vr template doesn't actually get you  to the place i'm trying to go as far as using   openxr and that kind of stuff so universal render  pipeline is my go-to because it comes pre-built   with a little bit of a scene and the lighting  pipeline is a little bit better i'm just going to   rename this to like quest 2 and then create while  that's spinning up let's open up the oculus app   on the pc go over into settings and then click on  general and make sure unknown sources is true over   here and then we're gonna go to devices and  if you have multiple devices you'll need to   make sure that your quest to is the active  device so make sure to turn it on and you'll   see here that it is now the active device but  if you wanted to swap it over to active you   click on it and then click this button that  says set as active and then we're going to put   the quest 2 in developer mode so to do that you're  going to need to go to the app so with your phone   or ipad or something open up the oculus app go  over to settings make sure you select the quest   to connect to that and then click on more  settings and then developer mode and make   sure developer mode is selected this lets you  add unverified apps onto the quest 2 so all of   our development can be added and built onto the  quest 2 without facebook's permission now we can   jump back into unity and see that we have our new  universal render pipeline project first thing we   need to do is go into edit and then project  settings and then inside of settings we're   going to go up to package manager and check  this box that says enable preview packages   and then check that i understand this lets you  download packages that are still in preview and   not pushed out to the 1.0 version exit out of that  now we're going to go up to window and package   manager right up here at the top next to this plus  icon we're going to click on packages in project   and change it to packages unity registry and then  scroll kind of to the middleish and find open xr   plugin and click install the openxr plugin is  the platform that allows you to create a project   have one input system and it will work on any  device so it'll work on oculus devices valve vive   any other vr hardware devices you're going to get  this pop-up that says do you want to restart and   it's going to swap your input system from the old  device-based legacy system over to the new input   system so we're going to say yes your project  is going to restart if you haven't saved it'll   prompt you to save and then the project will shut  back down and open back up and then still in the   package manager we're going to scroll all the  way to the bottom and find the xr interaction   toolkit this one at the moment is still in preview  so that's why you need to enable preview packages   so you can actually see this part we're going  to install this and this comes with a lot of   pre-built input actions and locomotion and that  kind of thing to move the player around and a lot   of scripts that we don't have to write ourselves  we're also going to expand samples and import the   default input actions this will set us up with  all the controls we need to set out with instead   of actually writing them all ourselves and then  one more thing let's go back into edit project   settings and we want to go all the way down to xr  plugin management so now that you have the android   platform installed you'll see there's an android  tab and there's a pc tab so just like all the   other tutorials we're going to check openxr for  the pc tab click on the exclamation point check   fix all and go into features and check oculus  touch controller profile still in the pc tab then   we're going to go back to xr plugin management go  over to the android tab and check on the oculus   i've tried this with the open xr plugin but the  issue i keep running into is when i try to build   in the headset it comes up as a flat screen almost  like i'm watching a movie instead of actually   putting me inside of the project so in order to  actually test out the project and build to the   quest to you're going to want to use the oculus  plug-in instead of open xr and by checking this   oculus plug-in it will automatically install that  plug-in and you'll get this other option down here   for oculus where you can adjust these settings so  just make sure your target devices the quest 2 is   checked let's exit out of this and go back into  the scene and start to set up our xr rig so the   default universal render pipeline project comes  with this little construction scene i always   think that the gizmo icons are way too big so  i'm going to scale those down so before we add   this xr rig we're going to add the default input  presets those are going to be located in samples   xr interaction toolkit whatever version that you  downloaded and default input actions so click   on each one of these presets and then up here at  the top in the inspector just click add to action   based controller and this will automatically  populate the correct controls for doing   locomotion snap turn teleporting all that kind  of stuff if we double click on this xri default   input actions you'll see that it's pre-populated  with all these different actions so with these   added it will automatically track your position  rotation the select which is your grip button   activate which is your trigger button ui press  and all these different actions here so we don't   have to go through and set these up manually you  could if you wanted to you could add by pressing   this plus sign up here and add a new action with  your specific controls by going into the binding   and going down to xr controller and selecting  your specific controller and what buttons you   want there so that's how you add a new action but  we're just going to use the default ones for this   if you're interested in a little more detail about  this kind of stuff i have a whole nother tutorial   specifically about how to use unity's new input  action toolkit so if you're interested in more   information about that i'll link it up here at the  top after we've added all these presets there's   one more thing we have to do in the settings we're  going to go to edit project settings and then find   preset manager and you'll now see that this action  based controller will have two presets one for the   right controller and one for the left controller  and then you'll also see the continuous move turn   and snap turn so these are all the presets that we  added we need to differentiate the right and left   controllers so in order to do that we're going to  write right and left inside of this filter column   and that will help unity understand which one  goes where i don't know why i can't just get it   from the preset name but this is how it wants to  do it so let's add our xr rig we're going to right   click over here in the hierarchy go down to xr and  then click on the room scale xr rig action based   if you've moved your camera on the scene at all it  will probably show up weird and not in the right   spot you can see it's down there in the corner  so i'm going to go up to transform right click   and click on reset and then i'll put it back in  the center of the scene and then i can reposition   it wherever i want so this box is going to  represent where the room space is not necessarily   where the character is essentially where the  player is going to be able to walk around   inside of their room so if you're building a room  scale game where the player doesn't actually move   all they have to do is walk around in the room  you want to confine all the things that can be   interacted with inside of this box and by the way  if you don't want to set up all of this and run   through the build settings that we're about to set  up and do all of these things then you can just   download this project if you want to support me  on patreon i'll link that down in the description   and you can just download the project and be  set up to run on quest 2. i really appreciate   all the current Patreons that are the whole reason  that i have this new quest too so thank you guys   so much and let's set up the build settings and  finish this out we want to add one component to   the xr rig to be able to operate it click on add  component and type in input action manager add   that one and then under this action assets there  isn't going to be anything in there right now   click on this xri default input actions and drag  it over and that'll put that as the element in   there and now you should be able to control the xr  rig so there's two ways you can run your project   in the quest 2. one of them is exactly like using  the rift s or any other linked headset to your   pc all you have to do is hit this play button up  here and make sure your quest 2 is in linked mode   so you'll need to click on settings go over to the  quick actions menu and then click on the enable   oculus link and that will set you up so whenever  you hit play in unity it will automatically run   that project on the quest 2 without having to run  a build or do any of that that's the fastest and   probably the most recommended way i would suggest  the other way you can test your project on the   quest 2 is by doing a build and actually putting  it on the quest to and this will enable you to   run your project the unlinked untethered but it  does require building your level every single time   you want to test which is a little more time  intensive but ultimately may give you better   testing results so it's kind of a pro and con do  you want to test it fast or do you want to test it   well kind of thing in order to do that we're going  to mess with the build settings so go over to file   build settings and then we want to add open scenes  so whatever scene you want to test make sure it's   up here in the scenes to build and then you can  check and uncheck the ones you want and then click   on this android here and if it's not downloaded  like we talked about at the beginning you'll have   an option to download the android build support  and if it is downloaded it should look like this   all we have to do is go down here and click on  switch platform this may take a minute it's going   to go through all of your configuration settings  and swap them over from pc or mac to android there   we go we have an option to build or build and run  down here at the bottom first we're going to click   this default device and swap it over to the quest  2 because that's what we want to build on and then   in order to build it and push it over to the quest  2 you're going to want to make sure your request 2   is on and connected via a link cable and then  you want to click on build and run it's going   to prompt you to write a name for your project so  i'm just going to call this one test quest 2 and   then if this is your first time doing a build it's  going to take a minute so it hasn't pre-built all   of the lighting settings or anything so depending  on how big your level is it's going to take a   several minutes but then your subsequent builds  are going to be a whole lot faster because it'll   cache all of that information from the first  build the reason i checked build and run instead   of build is because build and run will actually  build it and then put it on the quest too if you   just click build it's going to create a file but  it's not going to put it onto the quest 2 and it's   not going to run it so you would have to do that  manually so just clicking build and run skips some   of those steps and makes it easier there we go now  i'm going to pull up the quest and run the project   so all i did was put the headset on and it asked  me to turn on my controllers so i hit continue   and it threw me into the app and now everything is  working just as expected the lasers are tracking   to my controllers and i can move my head around  in 3d space now in order to exit the app all we   have to do is press the home button on the right  controller the oculus button just hold that down   and then we have the option to quit and that'll  take us back home and if i want to get back into   that build without having to run another build all  i have to do is press on the oculus button we're   going to go over to apps click the all drop down  and then scroll all the way down to the bottom   of unknown sources and then all of the builds that  you put on are going to be in here unknown sources   and having the quest in developer mode allows  me to have access to this folder here so this   one was called quest 2. so if i want to rerun that  all i have to do is click on it and that'll drop   me back into the project get a nice little made  with unity sign and here we are and just for good   measuring i'm gonna test running the quest in play  mode so if we go over to unity first we need to   put the quest into link mode so i'm gonna click  on settings go to quick actions menu and then   click on the oculus link button and that'll put  me over into the link mode oh it's saying my pc   got disconnected so i'm just going to unplug  my cable and re-plug that back in it's going   to ask me to allow access and then oculus link is  available in settings so i'm going to go over here   quick actions menu and then oculus link that puts  me over into link mode and now i can go to unity   and just hit this play button here and it should  run the app over in the quest um it lost tracking   on my controllers for a second so i had to just  click on the buttons and uh now it's tracking   everything and i can move my head around and move  the controllers around and everything works and   from here i could debug inside of unity so i could  use unity and you know go over into scene mode   and debug everything that's happening whereas  if i actually build and run it in the headset   i can't see what's happening over in unity so if  you're debugging or just you know doing major game   development i would highly recommend using a link  cable and just running it as if it was a rift s   or a plugged in device there you go now you can  develop games using your oculus quest too and   i look forward to seeing what you make if you  make something cool definitely add a comment   and tag me in it or join the discord and you  can show off in one of our channels if you   have any questions or if i didn't cover anything  quite to your liking definitely add a comment i   reply to every single comment in the comment  section so let's chat and uh until next week
Info
Channel: Justin P Barnett - VR Game Dev
Views: 87,215
Rating: undefined out of 5
Keywords: Justin P Barnett, unity xr, unity new input system, xr interaction toolkit, unity vr tutorial, how to make a virtual reality game in unity, make your own game in unity, oculus integration, oculus quest unity, virtual reality unity tutorial, vr tutorial beginner, How to make oculus quest game, oculus quest setup, oculus quest beginner, oculus quest 2, oculus quest 2 setup, oculus quest 2 developer mode, oculus quest 2 development, oculus quest 2 developer tutorial, unity vr
Id: wnn-dzHz-tA
Channel Id: undefined
Length: 15min 23sec (923 seconds)
Published: Wed Apr 28 2021
Related Videos
Note
Please note that this website is currently a work in progress! Lots of interesting data and statistics to come.