‫Hello and welcome.
‫In this lecture, we're going to be setting up a game mode and a custom player pawn so that we can walk
‫around our level as a first person player ready to play some gameplay mechanics.
‫Let's dive in and see how this works.
‫So we've already seen how when I hit play, I just go straight through the floor here.
‫So we kind of want to fix that so that we can play inside our level without fear of falling through
‫floors.
‫So the problem is that this SM floor mesh does not have any collision set up on it, so we can hit the
‫Browse to SM floor and content browser button.
‫We can open up the SM mesh editor and dock it to the main window and then we can go to the show button
‫and hit show simple collision and see that there are no simple collision meshes.
‫To add one in, we're going to go to the collision button in the toolbar and go to add box simplified
‫collision, which automatically adds it around the mesh.
‫Now, just to make sure we don't fall through this floor, I want to make that box a little bit thicker.
‫At the moment.
‫It's kind of zero thickness.
‫So what we can do is go in the details pane, scroll on down where we're going to find the primitives
‫collision section, and then under it there is primitives.
‫And this tells us, this shows us the different primitives that make up the collisions.
‫And some of the primitives are things like spheres, boxes, capsules, etc. We've got boxes, so let's
‫open up the box.
‫We can see its center is here, we can see the rotation, we can see the extents, which basically means
‫how large it is and the Z extent is zero.
‫So let's make that ten centimeters instead.
‫So you can see that's made the box slightly thicker, but I don't want our character to be standing
‫on top of the floor.
‫So what I'm going to do is I'm going to change its center to be at minus ten so that basically we've
‫got that box, but it's underneath our floor.
‫So you can go ahead and hit save to the mesh.
‫And now if we hit play, hopefully, there you go.
‫And we are able to walk around on the floor without falling through it.
‫Now, there may be other meshes that you discover that have similar problems and you can't you you can
‫pass through.
‫In this case, the doors for me are not actually wide enough to fit my character.
‫So I'm going to have to open these doors a smidge more.
‫So now that those doors are wider, we should be able to fit through them.
‫No problem.
‫And we do.
‫And we can now walk around our level as a first person character.
‫However, this first person character is set up for a first person shooter with first person shooter
‫arms, and that's not what I want.
‫So we're going to adapt this character for our own uses.
‫So let's find where that first person character is, and that's under the content first person blueprints.
‫And we've got first person character in here.
‫I'm going to right click on it and create a Child Blueprint class, which I'm going to call BP, underscore
‫player.
‫And this player, we're going to move to the root of content, click move there.
‫And then what we want to do is create a new default game mode and set this player as the default to
‫get spawned.
‫But before I challenge you to do that, let's modify this player so that we remove the arms that are
‫there.
‫So when we open up the BP player blueprint, you can see that we've got a bunch of components here.
‫One of them is the mesh one PE basically mesh first person, which is the arms.
‫And what we can do here is we can simply go down to where we've got these skeletal mesh property and
‫clear that so that we don't have any mesh selected to render for the first person.
‫Now, if we were to play as the first person player, we'll see that we now works exactly the same,
‫except we've got no mesh arms, but that requires a game mode.
‫So let me refresh your memory on how we create a game mode.
‫We go over into a level, we go to the blueprint button in the toolbar, we go to where it says game
‫mode, and we've currently got a Crypt Raider game mode.
‫And what we want to do is go into this and click Create and we want to create a new game mode based
‫off of this Crypt Raider game mode.
‫The Crypt Raider game mode is a C++ game mode.
‫So what we can do is we can create a blueprint version of it to link to other blueprint classes.
‫So let's click on the Crypt Raider game mode, click the root of content, and we're going to call this
‫game mode the beep underscore crypt Raider game mode and hit save.
‫And then we have our game mode launch up like so.
‫So I'd like to challenge you to set up.
‫Your own game mode, you're going to set it as the project default so that it's being used in any of
‫the levels you set up in this project.
‫Set the default pawn for the game mode to that player -- that we've just created and removed the arms
‫from.
‫And check that that is the -- that spawns in your game now.
‫Pause the video and have a go.
‫Okay.
‫We'll come back.
‫So first thing, because I'm here in the game mode already, I can select the default -- class.
‫It's currently set to the first person class, but I want to change it to the BP player instead.
‫I'm going to save that and then I'm going to go over to the dungeon level, go to the blueprint button,
‫and I'm going to check that our project default, in fact, it looks like we've already done this.
‫The project settings basically by having created it here is using the BP Crypt Raider game mode already.
‫So if I go ahead and hit play, you can see the -- created moves like a first person --, but I
‫no longer have those arms in front of me, which is more in keeping with the style of genre that we've
‫got here.
‫Great stuff.
‫So we've set up our character blueprint ready for some gameplay action, which we will start to do in
‫the following lectures.
‫I'll see you there.