Alright! I want to talk a little bit more about the VR template and how to
take existing projects and add them into your VR template so that you can
navigate them in VR okay because I know that's something that a lot of us will
want to do and in fact the project we've been working on for this class can be
brought into VR if you want to try that out so I'm in another project here let's
go through the whole process so that we know we're doing I've done a little more
testing on it to figure out how to figure out what the best way is to do it
for me that works quite easily so let's just do a new project and do a virtual
reality template and again to minimize how much stuff we have in there we'll
turn down or turn off all this stuff will say VR import create the project
okay we can save this one I'm in great give that a second to load up okay now
we've got a blank VR template created and we called it the our import right
now let's go back to open project and go to the project we've been working on I
think it's this one for me and the reason I created that blank VR project
so that I have somewhere to migrate this stuff to I'm going to show you how to
migrate this and then we can just take that and add it into our VR template so
what we're going to do is migrate this entire map here and everything that is
attached to it into that other scene so we need to find
this map in our content browser okay so by typing in first-person example map
you can see the name of the level here type it in you can find it in content if
we select that and hit asset actions migrate this gives us a hierarchy of
everything that's attached to this level so all the objects in here are going to
come but everything that is attached to them including blueprints or anything
like that will also come okay so you can see there's a blueprint in here a
trigger box that was from a later section of this course but it's going to
come with us because it's doing something in this
so I hit okay now it's going to ask you where to migrate that to and that's why
I created that other portion the Artest No
so now I just need to find that other VR test or the VR import project once you
find VR import you can go to the content folder and that's where you want to tell
this first person map to be imported to okay there's some overriding because I
had already imported some VR into there that's fine yeah we'll just overwrite
this usually you won't have that problem probably content migration completed
successfully okay good now we can go to our other project again and it will have
this level in there which is awesome vr import now we'll have to do a few more
adjustments to make the VR actually work in there and we'll be set and ready to
go now this migrate tool can be used for anything obviously and it's a good way
to share assets between projects so let's open level first-person example
and here we are in a VR template with our level okay and the reason we do this
is because the VR template we saw when we set it up we set it up with different
kinds of settings so you can either in your existing project go in and try to
change all those settings to something that looks more like the VR template or
you can just do what I just did bring it into here I think this is easier because
it's hard to find all the stuff that affects the VR template by just looking
through all your settings so I think it's easier to just bring it in to a VR
template where everything's right and then just get get all your geometry and
lights and all that stuff and blueprints into here okay now we do need to set up
the navigation mesh make sure that's right okay because that's not going to
be here with global obviously so like I said we need some geometry here and then
we need a nav mesh bouncing I showed you how to make that with the brush let's
make it with the actual volume that's here
navmesh bound volume and like I said the brush can be converted into those quite
easily but you can also bring it directly in so let's bring our navmesh
bounds over and there's just a few things we need to do to get this all
working okay you can see our navmesh bound is already going click perspective
view and look in there
okay our floor is all covered with green which means we can navigate around in
here with dr which is great now these cameras would go away you
don't want that anymore that's just for that mirror reflection
okay it was one other camera in here there these ones were for those ones are
for our real-time animations that we render so those are those are fine
whatever the thing we need to search for now because we're in the template for VR
there should be a VR pond in here actually it's called motion control pond
there it is right there motion controller pond and that's going to be
our new pond our new main character okay and it gets placed at zero zero well
wherever your floor is is where it gets placed because then when you put on the
headset it will lift up to your eye height and you'll be walking around at
your actual size and height so that's where you want that now the last thing
you have to do to make this work is to go here with the pond selected and it
needs to auto possess player zero okay that means this is the starting player
this is the default player that's how it's set up in the game settings and
that means that this pond is now going to be controlling your scene and that
should be everything you need to get in here all the other scripts these the BP
motion controller the HMV location pond that depends on if you're using the rift
or the HTC vive whatever but these are the blueprints that will run the
navigation the warping capabilities and the grabbing capabilities of your
of your VR headset so now that this is your first player you should be able to
navigate around in here you should be able to warp to anywhere where it's
green and if you put some grabbable objects in here you should be able to
grab them now in the next sections after this I'm going to be talking about
blueprints I've already made those videos so I'm coming back to this one
but I'm going to talk a lot about events that trigger things like this trigger
box here when you overlap this it turns on light one thing that you'll want to
do with VR and I talked about this in the last video how you can make objects
your grabbable so there's the 1 1 meter sorry 1 meter
cube this one and one of them is a 1 you can take up what's that thing called
pick up there BP pick up cube okay so bring this in actually let's do what I
showed you before and make a copy of it duplicated button let's call it a button
okay so that can be a let's open this change the static mesh okay the
scripting is already in here and everything's set up already to be a grab
full object which is great it can change the static mesh to whatever we want one
cool thing is if you change this to a chair and then place it properly then
that chair in your scene you could pick it up and throw it around and physics
would be applied to it it'd be cool it's fun to throw chairs in here and trust me
okay but let's make it a little cylinder compile and save
okay then we can just drag it into our scene and now this becomes a VR button a
floating VR button let's say on this wall right here whatever we want to do
with it
okay now there's a big old button on that wall kind of funny-looking but
that's okay that this is one way that we can use interaction in VR and I kind of
like this so now if we go over here and grab this this cylinder on the wall we
can make something happen okay so let me show you we'll talk more about
blueprints later but here's the events so instead of
picking that up this is what this is doing what this script is doing is when
that's picked up in other words when you walk over to it and grab it with your
trigger button on your HTC vive then all this is going to happen and basically
what this is is it's going to attach to your hand in physics is going to be
applied to it so you're going to pick it up it's going to be sitting in your hand
but if we delete it all that we can now say okay when we pick that up instead of
it attaching to my hand let's do something else like print string hey
don't grab me okay so in VR if you went up to that and
grabbed it you would see that this would now run and on your screen it would say
hey don't grab me okay that's obviously not a very useful script but this is how
you work interaction into VR you can use event pickup event and make it do
whatever you want so for example you could turn on lights change materials by
pushing that button okay so we'll get more into into that as we go into
blueprints but just know that this is a good way I'll show you overlap events
and other things like that but this is a good event to use to trigger something
okay you can also use trigger boxes and that kind of stuff but in VR this I
found this is a good way to trigger some sort of event by just grabbing an object
okay so that can be your button and in the next sections I'll show you how to
use blueprints to do things to use trigger events to turn on and off lights
to do other things and if you're working in VR just remember that you can use the
grab the event pickup event to trigger some of those exact same things so keep
that in mind as we move forward but that's how you use the VR template it's
pretty much that easy you just have to worry about that navigation mesh and
everything should be good and make sure that your motion pond is in there and is
is possessing player zero and you should be good to go