MAKE A VR GAME! Part 1 - The Setup

In AR/VR Development


MAKE A VR GAME! Part 1 - The Setup - read the full article about VR tutorial, AR/VR Development and Augmented & Virtual Reality Solutions from Daniel Stringer on Qualified.One
alt
Daniel Stringer
Youtube Blogger
alt

hello unity developer and welcome to a brand new vr tutorial series on how we can make a game using unity and the xr interaction toolkit in this episode were going to take a look at the unity setup installing the xr interaction toolkit and getting unity ready to develop for vr im also going to be going over what were actually going to be making lets dive right in [Music] if youre like me and love everything to do with gaming game development and new technologies then check out my channel ive got dozens of videos on how to create your own games and not the latest in tech and if you like what you see why not consider a subscription thanks very much and enjoy the video okay so the first thing we need to do is actually install the unity version that were going to be using for this tutorial series and if you go and installs you might be able to add in here and the one you want to add is the 2020.3.1 f1 and this is the lts version which is the long term support and which just means that theyre going to be constantly updating and fixing bugs for this particular version so once youve gone ahead and installed that if youre building for quest dont forget to install the android um build package um and any others that you want to include with it as well and then back in our projects uh this is where is this is where all your projects are stored and kept and what we can do here is were going to go and create a new 2020.3.1 f1 go ahead and click on there and were going to switch our template to the universal render pipeline template and also give our project a name im going to go ahead and call this world west shooter and then when youve done that go ahead and create and after a while unity will import some stuff and itll all open up so when unity is all loaded up youll be presented with your sample scene and an explanation of the universal render pipeline template all good stuff and then we want to go and click on window and then package manager now were going to get set up for vr and to do this were going to click on the cog and go to advanced project settings and im just going to dock mine to the side next to the inspector here because the xr interaction toolkits still in preview we want to enable preview packages and go i understand that this could ruin my life click on that and then back in the package manager you can go to unity registry and now you can see youve got all the review packages displayed to you here you want to scroll down to the bottom where its got xr interaction toolkit then click on there click on the little arrow to drop it down and we want to check see other versions and the version we want is 1.0 catchy name and were going to install that one so go ahead and install i hope you guys are digging the new camera angle as well for just try and do something a little bit different so now you can see the side of my face as well as the front of my face and then youre going to get a warning box where it says this project is using a new input system package blah blah and we do want to use the new input system the new action based approach so were going to go ahead and click on yes its going to install some stuff and once its done its going to restart when its all back up and running and youre back in unity you can go down to where the xr attraction toolkit was again and click on the samples and we want to bring in our default input actions we want to import those and this is going to be like all our action maps and for detecting button presses and stuff on our controllers we dont want to make these from scratch so were going to default the input ones bringing those its quite quick its done already so youve got a little tick then we can go ahead and shut down the project package manager window and back in the project settings under exile plugin management were going to go ahead and we are going to install this so were going to click on install xr plugin management and then youll be presented with a couple of options and youve got your build targets across the top on windows were going to go ahead and tick oculus thats going to bring in all the ocus related assets and under android because were building for quest well go ahead and take oculus 2 and then you see under our xr plugin management we do have the oculus appear just below and all these settings i would just leave for the time being and these are all good to go straight out the box we will go to our file build settings and im going to switch my build target from pc mac and linux to android were going to be doing it for the quest we can still test it using the editor on windows as well and on text to compression were going to go to astc and were going to hit switch platform and its going to do a bit of re-importing once thats all finished we can move on to the next step which is going to be looking at setting up our default input actions but to get your xray set up what were going to do is were going to create a new scene and were going to get a scene template were just going to create a empty built-in scene go create this is going to be totally empty no cameras or nothing and youll see here if we right right click in the hierarchy and go down to xr and were going to create a room scale xr rig you can drop it down and youll see that under camera offset youve got the main camera left hand controller and right hand controller and none of our actions are populated we would have to go through and create all of these if you wanted to do it manually um which unless youre nuts you dont want to do um thatll take ages and theres already something we can do thats done for you so let me show you how to set that up go ahead and delete that for a second and well go and click on our samples this is the samples that we brought in earlier you want to keep clicking on it until you go all the way down to default input actions and here youll find input actions asset which contains all the button presses for our controller which is very cool so these are all set up for you and theyre all looking for certain types of buttons on your devices so we dont have to make any of these its all done but we just need to get our xre to populate all that information for us now if we go ahead and click on the xri default left controller preset and well click on add to action based controller default click on that one ill do the same for the right hand add to action based controller default like so and then under your project settings and uh lets see if i can remember this preset manager need to put in a filter for our new controllers and so were going to go ahead and put right in the right controller and left in the left controller and now when you go ahead and create an xr rig in your hierarchy you will see that you have everything populated for you you dont have to drag in any of the actions click on the inspector and you go youve got more populated there which is way easier move that across a bit you can see weve got the position rotation and all the inputs all have um a linked input action reference which goes back to our action manager thats cool so thats set up now were just going to jump into another quick unity project where im setting up all the art assets which will just give an overview of what were going to be looking at creating over the next couple of videos lets have a look so this is what were going to be creating and were going to be creating a vr shooting game which i dont know if youve ever been to like a fair or like a theme park where theyve had these wild west shooters and its kind of theyre kind of weird um but essentially youve got like a row here like these guns that you can pick up and then shoot the targets inside this little hut and then have like a reaction or an action play out as a result of shooting those targets and theyre quite funny and comical and i thought this would be quite cool to make a little shooting game out of not necessarily all taking place in the hut it could happen all around you which would be quite cool and then this gives us scope to add in things like um shooting picking up guns teleporting around this little environment pressing buttons and then looking at how we can maybe use multiplayer so we can have different players shooting all at the same time uh or competing against each other and all taking place in this very small scene uh which my two top tiers are patrons im going to just give the all the art assets and all the unity projects as well um but for those of you that want to follow along i am going to do like some placeholder artwork so that you can enjoy learning it all together too and not have to worry about missing out on anything so lets quickly jump into the wild west and we can take a look at this in vr it should be all set up kind of ready to go this is no interaction in here literally just uh just the 3d environment ive been working on over the last couple of weeks and you can see its quite big in front of us here theres probably space for like four or five players maybe and then well be shooting and things will be going off inside the heart which would be really cool and there may be some things going on behind you as well you see theyve got a hitching post its behind us and got some of their and the cactus dotted around the scene and then i spent really far too long just doing the artwork for this but its a cool pretty cool 3d environment um very very simple one nice and small and contained in in terms of what well see outside of this 3d environment im not too sure yet um probably something a little abstract but im not sure how much that will clash with the artwork that we can see in front of us maybe well just do like a plain blue sky with some um kind of cartoony style clouds very much in keeping with some of the artwork that weve got going on in the scene already so there we go i hope you guys enjoyed the video this one is just a quick introduction in getting unity projects set up using the correct version which is 2020.3.1 f1 um and also installing the xr interaction toolkit and getting that all set up and ready then looking forward for the next couple of weeks were going to be taking it step by step and building up our vr game bit by bit and using all the common interactions so like teleporting picking things up interacting with buttons and objects in the in the virtual world were gonna be looking at audio particle effects socket interactors and loads loads and loads more stuff so if youre not subscribed and you want to follow along with these videos then go ahead and check out the channel and if you like the look of what you see on there then maybe consider a subscription but thats it for now but for next week were going to go ahead and take a look at bringing in our grey box artwork that will allow us to start the foundations of all our vr interactions see you next week

Daniel Stringer: MAKE A VR GAME! Part 1 - The Setup - AR/VR Development