 Hello. Welcome to the basics of VR and Unity Workshop. I am Alex Krasner. I'm one of the graduate assistants working for the virtual environment studio at the libraries at Virginia Tech. And yeah, let's get right into it. So, one quick disclaimer. I think if anyone has attended the live workshop version of this, I start by giving a very big, an extended overview of the basics of Unity. However, since this is the video form, if you're watching this right now, there's another video that covers the basics of Unity that I've already made. So, I would recommend you watch that first and then come to here if you want to focus on VR. So, anyway, let's get started. So, here we are looking at Unity Hub. All I did was open up Unity Hub, and I already have the latest version of Unity 2020 LTS installed. It is currently 2020.332 F1. At the time you're watching this, maybe 2021 will have gone into LTS. Whatever the case, I would recommend that you find the latest LTS version and install that for tutorials in general. Since then you will have the most stable experience. It's not going to be something that might have some bugs or get broken. But just so you know, we'll be doing this tutorial on 2020.332 F1 LTS. So, I'm going to make a new project. Let's make a project together. I'm just going to make a new project, make sure it's set to the version I would like, make sure I choose 3D. I know there's a VR one down here, but trust me, it will just make your life worse. But it does not really give you the tools you need to make a good VR application, or even the things to start on one properly. It's mostly just going to be in your way. So, it's better to start from scratch and to build it up yourself. So, we just click on 3D to do that. Give it a name, call it VR, open VR Workshop Project. Sorry for my typing mistakes. And yeah, we can see it's going into the folder Zcode. I'm just going to click Create. And now it's just creating it. And for now we will wait, and I will skip to the open version of Unity. And the project has finished loading. I'm going to just quickly go over one last thing, which is, you'll notice under here, I have chosen when installing to choose Android, UWP and Windows. You can access these if you don't have them installed by going to Add Modules and selecting them. You select all of the Android ones. You'd select Universal Windows Platform Build Support and Windows Build Support. Critically, if you want to run a game on Windows in VR, you're going to want Windows Build Support. If you want to run a VR application with the Windows Mixed Reality Headsets, you're going to want to make sure that you have Universal Windows Platform Build Support turned on. And finally, if you want to build something for Oculus Quest or maybe for an Android phone, you're going to want to make sure that you have Android Build Support turned on. Most of this tutorial today will be just for building for PC on just any old VR headset, but I wanted to make sure that you had a heads up on that. So, on to Unity. Alright, so now that we're in Unity, this should look familiar to you. If you watched my previous video that goes over the basics of Unity, again, Hierarchy tab shows all of our objects in a list and it shows us the relationships between them if they are parent or child of each other, which means if the transforms are linked to each other or not. The scene is where we can look at what our game looks like from any angle we want, whereas the game is looking straight from the perspective of the camera. The inspector is where we can see the components of each object and down below we have the project tab, which is our file explorer and our console, which is where we can see our errors. Okay. But the first thing we're going to do here is actually go to the asset store. So you may have this tab, you may not. If you have the tab, it's just going to tell you to go straight to the website. So when I click this, it should pull up the asset store right here in Chrome or whatever browser is your default. And you'll notice right now, by the way, when I click a yellow circle will appear. When I normal click and if I right click a blue circle will appear. So that'll hopefully help you keep track of my clicks. All we're going to do though is type in world materials free. You can see it already pops up for me, but I'll type it in here just for parallel press. And you'll see it says I already have it. It says purchased. It's free though. So normally there'll be something here telling you to add to unity or something like that. Make sure that you are signed in to the unity website with the same exact account as you are signed in in the unity app. If you'll you'll see when I click here in unity up top, there's a count. You want to make sure that you are signed in there. So you want to be signed in there and on the store. And then all you have to do is, you know, you click the add and then you'll say open unity. Should open it up in the package manager in unity. So what we're trying to do right now is we're just going to build a very basic little world for us to experiment with virtual reality. And so yeah, we're trying to get some materials, which are basically textures with material in unity is basically a texture, but with extra details and extra layers to it that make up how something looks. I think I went over that in the previous video, but I'm just covering it again just in case. So we're going to just import world materials free. If it doesn't start selected, you'll see it in this list and you want to click on it. So we're going to import it and it's it pulled this up normally will pull this up on your screen but it pulled it up on a separate monitor because of how I previously ran this workshop. So it'll pull it up on your screen. And all you want to do is click import. You're going to notice there might be some errors here, but there's nothing that will really matter as long as we don't use the error textures. You'll see what I mean in a moment. We're really just going to be using the the simple first folder that it gives us. You could if you wanted go through and carefully deselect certain folders that the ones that contain the issue I believe is the HDRP ones. But you don't need to. It's not really going to make a difference one way or the other. So here you see URP free couldn't open the file. That is fine. You'll see down here in our assets we now have world materials free. And the only folder here we're going to care about is built in RP materials. Go into here and you'll see all the materials live. So I'm going to close the package manager for now. We will be using it later. And I'm going to switch us over to the scene view and let's build our world. So first things first, when building a world, I like to have a ground. Let me get rid of this red, by the way, to get rid of any warnings. You just go into console and click clear. You can even choose when it'll auto clear, but I'm just going to clear right now. And let's make a floor. So to do that, I'm just going to go right click. You can also go to game object. I'm going to show it here is right click 3d object terrain. You'll see now we have this enormous area. It is exactly 1000 by 1000 unity in world units. And the unity in world unit scales to almost exactly a meter in the real world. But we're on the corner of it. You'll notice 00 is right here in our world space, but the thing just extends out in a thousand in each direction. So if we want to put ourselves in the middle of it, we don't want to move it to be 500 that way and 500 that way. So that there's 500 on all sides. So all we got to do is go to position and on our X, we type negative 500 because we're moving it back 500. And on our Z, we type negative 500 and boom. Now we are in the middle, our camera, our light, and everything is in the very middle of this enormous plane. Awesome. You can look around again. I believe I covered this in the previous video, but to look around all I'm doing is right clicking and holding and then flying around with W, A, S, D and E and Q. Cool. All right. So now we can see we're in the middle of this field, but I don't think, you know, most of the things you make, probably not going to want to live in like a checkerboard, right? So let's give this world some features. First things first, let's make it so that our ground looks like ground. So to do that, Unity Terrain have this special feature where you can kind of go around and paint them. And I don't know how much we're going to cover that today, but what we are going to do is cover building a, just like a little area to mess around with physics and VR. But what does matter is we do have to use their paint tool in order to add any color at all to this ground. So to do it, we just click on paint terrain. It looks like a paintbrush over here. I'm going to leave it on paint texture. All we got to do is go down here to edit terrain layers, create layer. And now that you've imported these textures, you should be able to find in here. In fact, I'll just type it in grass. And this one, grass clumps albedo. What this is, is think of it like the texture part of, there's a grass clumps material in here and the image part of it, the texture image, is called grass clumps albedo. And we're just going to add that as a layer. And so whatever the base layer is on a terrain will show up as the main color of the whole terrain. So right now we've got our huge world of grass. And perhaps in future videos, I will go over the features over here. There's ways to add trees, ways to lift up the ground to make mountains and different things. But for now, I'm just going to have us stay in the grass. But let's make a little room for ourselves. So first things first, I kind of want to know where the center of the world is. I believe the camera is starting actually at negative 10. That's not really the center. I'm just going to change that to zero. And let's fly over here. Okay. Let's add some walls. I think I'd like some walls behind the camera or around the camera. Adding walls is very simple. Just going to right click in here and create a cube. And you'll notice whenever you spawn an object in Unity, it spawns it a set distance away from the scene view camera. The way we are looking at the world right now, it spawns it at the center of our scene view at some set distance away. Which in this case means it put it underground and very far away from us. So let's get that fixed. All we have to do is just set the, all of these back to zero, zero, zero. The shortcut I always use for that is clicking these three dots and just pressing reset on the transform for the cube. Okay. One thing I'm noticing right now is that we do not have any handles to move around our objects. This is a very common thing that happens and people get confused. Like I'm selecting it. Why aren't the handles popping up? What I mean by handles is normally when you click on an object, there's arrows that show up around it. And all this means is that Unity has decided that we don't have a tool selected right now. So to select a tool, this top thing up here, these are all tools. I'm just going to click the move tool and suddenly there we go. We have arrows on each of these objects once more. And we could drag these around if we wanted to. All right. Right now it's inside of the camera though. So maybe let's, I'm trying to make some walls here. So probably make it pretty tall. How about 10? That's pretty tall. That's nice. All right. And then how about, I noticed that it's scaling underground but we just can't see what's underground. It doesn't have to be precise in any way. That's why I'm leaving a bunch underneath the ground. And we should also make it a little bit wide too, right? So how about on our Z axis, we increase the scale by, I don't know, 30. That seems pretty large. How about 15? That's good. Okay. So I'm just going to step out real quick, zoom out, take a look at this wall here. And right now, you know, white walls don't really feel that realistic. So let's give the walls a texture. You can choose whatever color you want, but in this built in RP materials section, you'll find all these materials. How about maybe a wooden, maybe this one. Yeah, I like that. Wooden flooring, even though I'm using it for a wall. You'll notice that the texture gets stretched because we are scaling the, because we are scaling the object. There are ways to mitigate that by changing the texture itself for the object. But in this case, we're just kind of going to let these wood planks be really wide since that's not the focus of today's video. The focus of today is to just mess around with VR in Unity. So we've got ourselves this big wooden wall and now we're going to make a copy of it. I'm just going to right click on Q over here and click duplicate. And you'll see the duplicated one is selected. So when I drag this across, it leaves the other one behind. Looking good, looking good. Let's make one back wall. I don't think we need a front wall. So I'm just going to again duplicate. And I want to rotate this 90 degrees around the Y axis, the vertical one. I want it to turn clockwise. So we do positive 90. There we go. Let's make this our back wall. I know it's very haphazard. It's not very precise. I'm sorry to those of you who may be feeling a little annoyed at how imprecise it is. But feel free on your own to make them as precise as you would like. Okay. The next step though is to add a little something for us to play around with in VR. I like to play around with spheres are pretty cool because if you have a sphere, it'll roll around, which means you can kind of throw it, bounce it off of things. So let's make a little stand for our sphere to sit on and let's make a little ball. So first things first, I'm going to add, this time I'm doing it from the top menu just to show you how you do it, going to add 3D object cube once more. Send it back to zero again because it put it into the middle of the void. And I think this is a pretty good height for it, honestly. I'm just going to move it over here. And let's give it a color, something to look like. How about we make it out of brushed aluminum? I like that. Cool. Alright, we have brushed aluminum stand. Now let's make our sphere. So we just go to 3D object sphere and boom, sphere. Once again, they placed it way below the world. I'm just going to reset it. And it's now over here. This is a pretty big sphere though. This sphere is almost, it's like a meter by a meter. That is probably too large for holding. If you picked up a ball with a meter diameter, you'd probably have a difficult time holding it and throwing it around and stuff. So let's change the size. How about maybe 0.2 times? So I'm just going to go into scale for it and type 0.2 for each of the coordinates. I believe there's something new in Unity 2021 where you can link all of them together, but we are not in the, we are in 2020, so. Alright, and this ball is pretty high above this surface, but you know, let's leave it there so I can show you physics later. For now, the last thing to do is to color our ball. I really like these hexbricks. It kind of reminds me of a soccer ball. So I'm just going to place that on it. And there we go, there we have it. Alright, so now we have our sphere in our little playhouse and the rest of this large expanse. You'll see if we look through the camera right now, it's just looking out there. I kind of want the camera to point at the ball so that we can see things. So I'm just going to go to main camera and I'm going to turn it negative 90 since it's looking at that way. I want to turn it counterclockwise to the y-axis. I'm going to go negative 90 and boom, now suddenly we are looking straight at the ball. Fantastic. Alright, now one finishing touch I want to add here is I want to make it so that this ball has physics so that we can play with it once we get into VR. So the last step is we're going to give the ball physics. You'll notice right now if we press play it shows the balls are staying there in the air. It's not really a dynamic object. So to give the ball physics all we have to do is click on its name, click on sphere, go to the bottom you'll find add component and when we click on that we want to type in rigid body. Do not click the 2D one, make sure you click the normal one. Alright, that's it. As soon as you put a rigid body onto any object in Unity it gains physics. So let's take a look right now if we press play. We should. Yeah, you saw it fall. It was very quick because gravity is pretty fast. But yeah, now the ball has physics it's able to fall, it's able to roll and we'll be able to play with it soon. Okay. Alright. So the next feature that we want to do is add VR. Let's get in there. Let's start playing around in our little space we've made. So first thing we want to do is go to edit project settings and at the very bottom you'll see something called XR plugin management. And when we go there first thing we got to do is install it. So click install and it will install the XR plugin management package into your project. And yes, you will have to do this every time you make a new project. So alright, we've got all these menus up here. Today we're going to be focusing on building for PC VR. But if you wanted to set up things for perhaps maybe running on Oculus Quest you'd go over here. If you wanted to run it on a Windows Mixed Reality headset you'd want to go over here. But today we're just going to do PC and we're going to use something called OpenXR. This is the new standard. Any new headsets coming out are almost exclusively using OpenXR as their plugin for running VR things and AR things these days. So that is why we're going to use that. And you'll notice once we click it that it says that it uses the new input package. So we need to restart to enable that. Just click yes, it's going to restart your Unity and thankfully it asks you to save. So alright. And once it restarts we have our OpenXR plugin added. Now you'll notice there's a little warning sign here. When we click on it it should pull up on your screen this called OpenXR Project validation. So to fix this to fix these issues all you have to do is just press fix all and it will fix one of them. There's one that we actually have to fix by hand. So it'll just take us right there if we click edit. What they want us to have is an interaction profile. Think of this as the way that the system knows how to talk to your headset and your controllers. You know if you have different controllers and different headsets there's a bunch of built in profiles for like how to understand the inputs from those. So all we got to do is click this little plus button and I'm using Oculus touch controllers but let's say you had a Vive, you choose Vive controllers. If you wanted to make it for everything you just add all of them. So you choose HTC Vive you choose Valve Index, controller, yada yada yada and these are all different platforms of controllers which it will understand. You could even use the hand interaction or eye gaze for different types of things that allow it. One last thing we want to do while we're on this page is change our render mode to multi pass. The best way to think of it is if you're doing single pass the computer looks at the scene through both of the person's eyes but then renders the image as one image kind of stitched together and what this means is it's kind of taxing. It's pretty difficult to rewrite the full image over and over again rather than rewriting two separate images at the same time over and over again for because in VR you're always going to be rendering the viewpoint from each of your eyes so anyways but using multi pass that changes it so now it kind of renders both of our eyes in parallel however if your computer can't handle running this kind of task in parallel then you might want to stick to single pass but multi pass is drastically better for VR it's really the recommended way to go and you'll find that lots of textures don't work when you're in single pass in VR so definitely recommend changing the setting multi pass just wanted to give you a little background on it okay so you'll see now there's no issues left we can close this and we will move on to adding the interaction tool kit so we have some interaction profiles but we don't have anything coded for how we want to use the controllers right maybe it can tell us like it's getting the data from the controllers now but it doesn't know like what to do with that so you could code the whole thing from scratch but that's a lot of work instead we're going to use the sample ones that they give us and build off of those so to get to them all we have to do is go to window package manager and you probably don't have as many packages showing up as I do when we do this but let's go to unity registry so I just clicked here I went to unity registry you'll see a very long list if we scroll all the way to the bottom you'll notice XR plugin management is installed that's what we did if you wanted to install it you didn't even have to go to project settings you could just come straight to the package manager and install it but I think it's nicer to just kind of already be in project settings and you'll see right above it we have XR interaction tool kit so this is something we want to install it will basically give us the ways to interact with stuff in VR and AR so we're just going to click install it's going to add it to our project and it will let us do cool things add to our project and add to our project and now we just wait for a moment so they've changed the way that interaction mask layers work it's not a really big deal for us all we do is just click ok and it's done we have all of the features now now all that we have to do is add the sample assets that they give us so we just click on the little drop down click on starter assets you can ignore device simulator it is kind of nice it lets you simulate being a device in the play button view but personally I would rather just put on a headset and try it out it already imported the starter assets and now we can close this window there's one last thing I want to change up in our project settings and that would be under quality and I just want to change the pixel light to 1 texture quality it's good change the pro texture turn off soft particles this should just help you out if your computer needs a little bit of help you could leave it on but I would recommend making these changes it in general helps with running VR it's a tough thing to run and render anywhere ok so we've made those changes now what we want to do is set up there's like one last kind of weird thing we have to do and we're going to be setting up the controllers with we're kind of connecting them to the samples we just downloaded to the sample interaction kind of techniques that we just downloaded in samples so to get to that it might already be downloaded here in my closed project settings it should show it might already show up here it would be under samples xr interaction toolkit 201, starter assets and you'll see these things that look like weird slider boards and then one thing that looks like a map with a lightning bolt and a play button alright we're going to click on each of these and we're going to click this button up top add to action base continuous move provider basically when we click this button it adds kind of like a preset for how we are going to be moving around in the world to to our preferences so I don't know it's a little bit confusing and I hope in the future they streamline this a bit more but for now all you do is you click on each of these and then you click the button that shows up up top you'll notice when we click it it changes to say remove so if it says remove that means you already added it you're good so once we've added all five of these the next thing we want to do is change one more thing and that is under edit project settings I know I just closed it but I just closed it to get out of our way we're going to go to set manager and you'll see the names of all of these are now populated here so what do we do we just want to right here we want to give a filter so that all of the right controller things get sent to the right controller and all the left ones get sent to the left controller all we have to do for that is type right under right and left under left I know it seems kind of opaque and weird but it's just what we have to do right now with how they've built it so that's what you got to do and we're good to move on to running VR so you may notice we still have our main camera here and our main camera is kind of in 2D let me clear these out our main camera is 2D right like it's rendering to a flat screen that we're looking at as VR enthusiasts would call it it's a pancake game but let's make it into a 3D game all we have to do to do that is kind of swap out this camera and the way that you do that in OpenXR is once we've installed all of the stuff once we've set up all these things that we just set up we want to right click here go to XR you'll see this is a new category here XR and I want to choose XR Origin action based you're going to notice we're going to be choosing a lot of things that are action based because that is the new version so you may like this old XR Origin there may be other ones just remember to always choose action based if it's an option so XR Origin action based what happened to our camera well what happened is the XR Origin takes the camera if we go into scene you'll see it kind of takes ownership of the camera moves it inside of here inside of an offset and so that's why it took the camera away from us where is the XR Origin you might ask in the middle of nowhere because every object that you spawn always spawns that set distance away from the scene view like I said so we just want to take it and move it back to zero zero now I'm going to take the XR interaction manager which is also down in who knows where and bring it back as well now everything is where it's supposed to be alright if you were to hit run right now you would be able to look around in VR assuming you have a VR headset connected however you would not be able to move around your hands so the final thing we need to do is add something to this interaction manager so it knows how to access our hands to do that we want to go to add component we want to type in input action manager and you'll see I just typed I and it already showed up alright and then under it you'll see action assets the assets we want are this weird map looking thing that's stored inside of samples XR interaction toolkit 2.01 starter assets so we first need to make a space for it so I'm going to click this arrow I'm going to add a plus to add an element and I'm going to drag the map with the lightning bolt into this little box and we're good now it knows how to control our hands so I'm just going to save just in case and let's show this on a VR headset so if you're using an Oculus Quest 2 and you're plugging it in through anything you will need to make sure you have the Oculus app open and I'm going to use error link which means that I need to have settings turned on for that just want to take your headset and enter link mode and if you're on something else then you should be good to go as soon as you've effectively plugged in your headset you may need steam VR to be open for it to work if you have a steam headset and yeah everything set up I'm just going to click play let's see how it goes there you have it here I am mystical magical world of my creation I've got these almost like lightsabers for hands and yeah but you'll see I can't really move around I can move around in my space but I can't walk out over there how am I going to get there so the first thing we should add is a way to move alright so I'm going to take off my headset turn this off and let's add movement so they make it really really easy to add movement otherwise known as locomotion to your VR game all you got to do is right click here to go to game object but I just like to right click it's easier we go to XR we go to locomotion system action based and voila here are the different ways to move around and you'll see by default it already gives us a teleportation provider and a snap turn provider and this is all of the instructions basically to let us teleport and let us kind of turn where we're looking at something called a snap turn the one thing with teleporting though is that you need to tell unity if a place is allowed to be teleported to or not otherwise you could just teleport up a wall right so they want you to specify the area that you're allowed to teleport in so to do that we need to make either a teleport area or a teleport or a teleportation anchor so the teleportation area here let's add one let's bring it up to zero zero and maybe pull it a little bit up so it's not clipping through the ground so here's the teleportation area I'll put that on the left to show you how it works and let's add a teleportation anchor as well just go to XR teleportation anchor zero it move it up a little bit so it's not clipping and move it over to the right side you'll see the main visible difference immediately is that the teleportation anchor has a weird little box in the middle well, if we press play if we put on our VR headset and then press play we'll see that that box disappeared right now, right? and when I hover my kind of red lasers over each of these these are red cast pointers when I hover them over them, you'll see it turns white okay to select we pull the grab button so that may vary depending on your controller on the oculus quest it's kind of the one that's where your middle finger is not the trigger so you'll see when I pull it I can teleport to wherever I'm pointing um though the color white definitely is kind of blending in here so it's not really helping me show you okay but you'll notice when I clicked over here so that side over here, right? this is the teleportation area I can click around and I can point and go to anywhere I want see if I'm in the shadow it's easy to see I can point and go to anywhere I want but if I click even on this corner of the teleportation anchor I'm in the middle think of it like a teleportation area is an area you want to be able to move around freely but an anchor is something that's for specific spots maybe like a a seat in an arena or in a lounge or something so if you want someone to be able to jump and sit in a virtual seat you probably would choose the teleportation anchor since it always puts them in the same exact spot alright and also we have snap turn enabled which means I can press sideways on my control stick and it will push turn me around a set number of degrees right now it's 45 alright but you'll notice we can't teleport anywhere over here right we can only teleport to these areas I want to change that we want to be able to teleport across this whole terrain right so I'll show you how to do that first turn off the VR and the first thing we want to do I'm going to do is I'm going to delete this anchor because I don't really think we're going to be using teleportation anchors today much just want to show you how they work and if you look at teleportation area really all it is is a plane with a teleportation area script on it what this means is if we delete this one we can just put the teleportation area script on anything we want to teleport to so I'm going to put it on the terrain just going to add component on terrain teleportation area and suddenly you'll see when we go into VR here we go you'll see when we go into VR that we can teleport anywhere that we can point really fast we can even walk over to the ball we don't have any way to touch the ball yet hmm what if we want to grab the ball let's add that let's add a way to grab the ball what we have to do to grab the ball is add the component called XR Grab Interactable so to do that I'm going to add component XR Grab Interactable on the sphere and we get this big script there's a few things I want to change here first I want to change how physics works for this I think we want something more precise we're going to be playing with it so let's change it from discreet to continuous dynamic on the collision of the rigid body then I also want to change the way that it knows where the ball is I wanted to throw it around so we need to keep track of the velocity of the ball rather than just its position so to do that I'm going to go to movement type and change that to velocity tracking and if you want people like to turn on smooth position which basically just means that it will be less erratic in its movements but I'm okay with leaving it off and you'll notice that throw on attach is on alright let's go see what this does gonna save let's run let's go teleport over there and you'll notice we still can't touch the ball but we can grab the ball all I have to do is just hold the grab button while pointing at it and it will suck it to me and I can just throw it up I can catch it out of the air bounce it off the wall sorry about that I can bounce it off the wall I can to the extent that it could bounce it's not really a bouncy object right now it's made of rock we can pick it up, we can throw it we can drop it over here and let it roll we can throw it between hands there is one weird thing that you're gonna notice though which is you can move it forward and backwards that's kinda odd right most of the time I don't think you're gonna want this if you want it sure that's fine but I think we'll let's turn that off let's make it so that we can't move that around anymore along with let's change some other stuff too but first let's do that so all I gotta do pick up my headset and let's go to our hands cause that's where this issue is first thing we're gonna do is we're going to select both of our hands at the same time to do that we go into XR Origin camera offset and hold control and click on left hand controller and right hand controller it'll select both of them will happen to both of them so all we wanna do to make it so that we can't kind of push the ball in and out is turn off anchor control which you'll see down here under XR Ray Interactor I'm gonna turn that off that's a pretty simple change now it won't be able to move forward and backwards but there's a few other things we could do right now we can't even touch the ball so we wouldn't be nice to have some hands of some sort all we have to do to make hands is to give a model prefab to this little line down here on each controller so anything you put into here will be a hand so let's make a hand this is gonna be a little bit weird but we're gonna do it so I'm gonna go to assets so that we kind of have a clean little folder here I'm gonna zoom out up here and let's I think like capsules would make for good hands so I'm gonna add a game object for the object capsule once again I'm gonna zero it because it's in the middle of nowhere and it is pretty big I don't think you'd want your hand to look like this how about we make this a little bit more hand sized there's a couple things you need to know about making hands the first is that it will point in the direction of this blue arrow so whatever the blue arrow is pointing at is kind of like the pointing side so let's make our hands small it would be like 0.1 0.1 0.1 and let me zoom in so you can see it and I want this capsule to lay along this axis because again the blue arrow is where our hand will be pointing so I'm gonna tip it sideways I'm just gonna go to rotation along x set that to 90 and now the green arrow is where it will be pointing but you get what I mean well actually there's it's not totally done this is the really weird step we want to create an empty object it doesn't matter what you call it we want to put this capsule let me first make sure the object is at 0.0 we want to put the capsule into the object like it's a child of this empty object so that now the game object now the blue arrow does line up properly that's what we're kind of doing here there's a few other weird things going on just trust me and follow these steps and you will have hands alright just make a capsule turn it sideways put it inside of a game object make sure they are both aligned at 0.0 you'll see this one says 0.0 this one says 0.0 alright and now we're gonna take click and drag game object down to here and it will make a prefab of the object we just used the combination of these two that we just made again a prefab is like a think of it like a bunch of different aspects of an object all predefined all already laid out so in this case this prefab has a capsule turn sideways inside of an empty object now that we've made the prefab we don't need this anymore get out of here we have a prefab down here so now when we go to our hands I'm gonna control click on left hand and right hand controller I'm gonna go down towards this model prefab and we can just drag in the prefab alright now we should be good we will have hands these capsules have colliders on them which means that we will now be able to interact with the ball as though we had kind of physics hands so take a look so you'll see now here we are I can teleport around everywhere I can walk up to this ball and I can hit it moving pretty fast we'll see when we grab it that it wants to go to the middle but it's held back because again now our hands have physics it's pretty fun we're gonna hit it with our hands now we throw it we're gonna bounce off our hand so that's pretty cool alright now to add some more stuff how about walking around without teleporting that might be important so let's take off our headset let's turn off the VR and let's go let ourselves move around smoothly all we gotta do is go to locomotion system and add in it's called smooth sorry it's called continuous continuous continuous move provider we want to choose make sure you choose the action based one remember there's gonna be action based and non-action based so pick action based and here's another one you can add this continuous turn provider action based think of it like normally we're snap turning around which is better for sim sickness the reason we teleport by the way is your brain if you're moving in VR it thinks that you should be feeling forces on your body and on your head from the acceleration of moving forwards and when it doesn't feel those it starts to make you feel sick it thinks you're poisoned if we turn our body like if we're smoothly turning in VR our body will wonder why am I not feeling a twisting movement and it will think that we're sick to avoid that typically you use teleportation and snap turn but once you kinda get your legs in VR you're able to probably handle more continuous movement and a lot of games require continuous movement so to deal with that we would just add in a continuous move provider when we have a continuous move provider we wanna make sure we disable the teleportation provider because we're not gonna do both at the same time and we also need to set this up to work cause right the move provider think of it like a joystick you're just pushing in the direction and you'll move that direction so move ourselves around we probably want one hand to move and the other hand to turn so I'm just going to choose my right hand for movement sorry I'm gonna choose my left hand for movement and my right hand for turning that's kind of the typical that's the usual way that it is in most games right so all we have to do to do that is turn off right hand to move action use reference, uncheck that for continuous move provider and for continuous turn provider we wanna uncheck the left hand alright so now I should turn off snap turn provider as well okay so now if we press run see we're back in this world but if I push around on my left stick and it's head based by the way so it chooses where to go based on head there's ways to change it so it'll go based on your controller but right now we're just using it this way and you'll see I can move around wherever I want I can kind of walk on over here I can hit the ball why isn't the ball triggered yet hit the ball around I can do whatever I want and I can also turn smoothly and wow smooth turning really gets me even if someone uses VR a lot smooth turning definitely causes a bit of nausea it's definitely the most intense of any of the movement things that you can do in VR so anyway we can smooth turn now we can smooth moves how about getting rid of these weird lasers I think that's a really common thing people will want how can I instead of like grabbing with a laser what if I just want to like you know pick it up when I get close to it so let's add that real quick take off my headset and the next thing we want to do is add grabbers kind of around our hands to do that we want to go to our controllers I'm going to click on both scroll down and you'll see all of these line renderer XR interactor line visuals turn that off turn this one off we don't want any more lines we just kind of want to grab as though it's with our own hands XR ray interactor off we want to add a new feature so to do that we want to add something called XR direct interactor XR direct interactor I forgot it'll tell you if you mess up that you aren't even allowed to have a ray interactor at all on a something where you want to have a direct interactor so it's not enough to just disable it you have to remove it so I'm going to go over here I'm going to remove component is it going to remove it from both of our hands by the way okay rest of these can just stay disabled so I'm going to once again add XR direct interactor here we go it's missing one thing though it doesn't know where our hand is it needs to have kind of a collision box for what our hand would be for it to know if it can pick things up yet so we want to add a little collider sphere shaped collider to both of our hands right now we have both of our hands selected so to add this collider all we got to do is go to add component sphere collider and it's probably pretty big right now it's actually pretty massive let's downsize that a little bit maybe the radius should be ooh the center's let's center that and let's make it maybe half the size right that sounds about right to you let's go right now it's at 50 what if we changed it to 0.2 yeah that's probably a good radius around your hand the last thing we need to change about this is we want to make sure it's set to is trigger and then you're good so let's give it a try I'm actually going to go back to a locomotion system real quick because of how painful continuous turn is I'm going to turn that off I'm going to turn back on snap turn and I'm going to make sure that's also only on my right hand okay so saving let's go into VR once again so click the play button I'm going to get my controllers real quick controller alright here we are back in the world I can snap turn I can walk around wherever I want and now there's no more lasers right no more lasers so let's let's kind of walk over to this ball when I grab I can grab and it just kind of jumps to my hand right so I can't do it from a distance anymore I got to get up close and then I can grab the ball we could if we wanted we could turn off physics when we're making the prefab so that doesn't have physics it'll jump right into your hand but right now we just kind of keep it on because it's fun to be able to play with objects I could let go of this I can balance it between my hands it's kind of fun okay so ending play the final feature we want to add is the ability to run this on any computer any device it's right now we can kind of play it in here but it's choppy here it's not efficient and if you want to be able to run it you know on a quest you want to be able to run this on a computer you want to give this to your friends this game you made you're going to want to be able to export your file as an executable package it up so all we do for that so you want to go to file build settings you want to add open scenes and then you would go to build when you click build it'll ask you what folder do you want you're going to want to find somewhere you can have a little folder because it's going to put all of the materials with it as well so kind of make a zone typically I have this thing called code and in code my code folder I have a bunch of sub folders for my projects each one I have okay so I'm not going to export it today it takes a long time but that's what you'd want to do alright so yeah, given that you've followed these instructions you should be able to make a simple VR game and you can always add things on to this in order to do more stuff you know create new hand shapes build different worlds make different areas to teleport to all the mechanics you want to do but I hope this has covered the basics of making something in VR if you want to go try out some VR headsets stop by the virtual environment studio on the fourth floor of the library in 4020 and we have a bunch of different kinds of VR headsets and you can come and you can even play games and you can borrow a headset you can go to the studio's technology landing desk on torg bridge and there you can rent you can borrow VR headsets and even you can even borrow more intense pieces of equipment from there even board games all sorts of stuff there so definitely check it out and yeah and so I've been Alex Krasner GA at VES thank you for coming to this workshop