Let's Create FPS Controller Foundation - Blueprints #2 [Unreal Engine 4]

Video Statistics and Information

Video
Captions Word Cloud
Reddit Comments
Captions
however um I wanted to bring you all a bonus let's create video this week I decided that before we move on to any more mechanics such as traces recall hanzo scatter shot or the titanfall to wall running and all the other fun stuff would make her in project together instead of relying on unreal templates we'll learn how to create a blank project from scratch we're going to develop our movement camera look and our own little level this will set the foundation for all videos over the next few months later on we'll move on to looking at third person games and doing it let's create in that style at that point we'll also create a blank project and do it all from scratch so now let's begin as I explained to Elia we are not going to use any of the default templates we are instead going to use the blank project and let's call this out let's create project and hit create project the first things we want to do when we start this is to set up our folder structure we then want to make an FPS controller blueprint we want to make a game mode and then we're going to go into creating a little level as I mentioned before so now inside of here let's create a folder structure so we'll need a maps folder we'll also be needing a blueprints folder and we'll need an art folder which we will use in another episode we're then going to have to save this map so hit save current go to maps and we'll call this our let's create map now we can't lose any progress here we can now go into deliverance right-click create a blueprint class we want to create a character so characters type upon that includes the ability to walk around call in an FPS controller and let's open this up and do some setup in here so you'll notice there's nothing here it's very different to the template we're going to set it up so we can use it like the template don't forget we still have all our character movement stuff here we just get more control over what we create in here we get to do it by ourselves the first thing we want to do is create a spring um now you probably know this as a camera boom that's what they usually rename this this spring um is going to allow us to change distance with camera it's going to allow us to do some cool stuff with being able to get the input of the mouse and affects our it a tional II and we can also use some of the lag settings to create weapons way later on we're then going to create al camera and because I have this selected it became a child if you didn't just drag it onto spring um and it'll become a child now the problem you see here is that touchless and camera needs to be inside of this collider this capsule Collider so let's go to spring um and we're going to make the target arm length zero where they're going to move the spring arm up a bit and that looks pretty good too near the center the only other thing we want to do is use poun control our rotation because we want we want to control the rotation with our mouse input so we're going to click that click compile save and now we've done all the pre setup we can make a game mode to create blueprint game mode base FPS game mode and we can edit this game mode so as you can imagine a game mode allows us to control what mode the player is currently using in this case we're in FPS game mode you could have multiple game modes to capture the flag with unique settings so different clients on servers appear and all kinds of stuff so we're going to keep it super basic there and we're just going to create our normal game mode and we're going to first have a look through here so we don't need a session we don't need to state what we do need is our default pawn class which is that first person character and now the folk form class is the character that is the pawn I should say the pawn that is going to spawn in the level by spawning our FPS controller we can control that character but we're not done yet we still need to go to settings project settings and inside of project settings we need to set the appropriate game mode in this case instead of the game mode base which is default that unity unreal comes with we need to go to the FPS game mode now what will happen is if we close this hit play we have spawned in as the player you might not understand why but we can't actually move if you try to move around that means it was successful what we did now before we get into programming anything we need to set up our inputs so go to settings project settings and we're going to look at the input manager which is down here we have action and access access is usually for movement action is usually for some form of actions such as shooting jumping and dashing all those things so we're going to go into axis mappings and what we need in here we need to set up our horizontal and vertical movement we are then going to give it an a value which is the keyboard for a we're then going to give it the D value which is the input to D and you can also give it a gamepad if you like but we're not going to do that in this video W F and then what we're going to do is set the a to negative one so we can move left with a right with D forward with W and then back negative 1 with s we then need two additional access mappings and this is mouse look or of horizontal and Mouse look vertical and what we're going to be doing is tracking a horizontal and vertical movement so in here we're going to get Mouse and we're gonna get mouse X and in here we're going to get mouse wire so the why we need negative one so it moves up and down properly unless you like to invert the controls the only other thing we need now is to add in B jump action mapping so type in jump and we're going to use the spacebar all right this is everything we need to get set up so now we can access these inside of our blueprint so we're going to go to the FF controller and we're going to begin so we're going to start with our mouse input to right click and we're going to put input and then mouse click horizontal right click type in input again mouselook vertical and when it comes to turning left and right looking left and right we need to add controller your because that's the left and right and give it this axis value so it knows which way we want to turn then for this we need to use pitch so add controller pitch input and drag the axis value into that let's test if this worked and you should be able to look around if it's inverted that means you just need to change the the minus one in your setting with your game settings and now something I learned off the comments the other day you can just highlight all of these press C and type in Mouse input so thank you everyone who commented that that was really helpful the next thing we want to do is get our movement input to do this we need our input access we need to get horizontal and we can just type in vertical because we know what that is so vertical and we're going to use an awesome node this node is called add movement input which takes in a direction and the scale value our scale value is of course our axis value and our world direction is which direction we want to move in which is our write vector so get right vector I'm going to plug that in there and then we're going to get before actually one other thing I want to mention just a quick demonstration when we move our mouse we could potentially end up in a situation where our characters like this looking at the if you're looking at the ground like this if we have rotated a character like this looking at the ground and you move forward the movement will be slower we need to set up something so our character can only look around on the z-axis and move around on the z axis that way everything will be fine when it comes to the rotation in order to fix that what we need to do is get control rotation we need to then split this into three and the value I mentioned is Z so remember we only want to move around the Zed make rotate oh we're going to break break link Zed we're then going to drag that into here whoops into the inrun we're going to hit compile save and let's see what happens so now we can move left and right if we look down we're still moving at the same speed if we look up we're still moving at the same speed that is the only reason we put this in here now we're going to finish yourself by doing the exact same steps we did here so add movement input we're going to get the for vector we're going to check that into scale value and then check that into well Direction compile save hit play and now we have first-person movement the only thing missing is our jump and we're also missing our Comment by the way you can just delete these so now we don't need those so you select these comment movement input and if you want to tie these tidy these up feel free to I'm probably going to do it later and the only other thing left now is to get out spacebar input so we call this jump in all space haha so get jump and jumps really funny because it's just a node called jump and you might be wondering well how do we modify the speed and stuff all of that stuff in terms of whoops mess up all of the modifying of drum and speed you go to your camera movement and you can find your jump and following controls I'm going to set our air control to one so we have maximum air control and if you want to change the height it's just this here same thing with speed you can change all of your settings here so let's hit compile save close this hit play and now we can jump and move around a tiny level we have done that whoops escape we've done nearly everything that we needed to do there is one bit left and I want to create a small level with you guys so let's go and hit add add new add feature or content pack we're going to go to content packs and we're going to create the starter content and we're just going to add that to our project this comes with a lot of cool stuff some basic materials a few different types of walls ramps doors a lot of stuff that we can use to quickly set up our project and by having this for all future projects we can try lots of different things while running sliding off ramps stuff like that so if you if you want to your starter content you've got all these things we're going to go into our architecture and we've got floors and stuff like this so we're actually going to delete this the default floor dragon floor we're going to give it a location of zero zero zero so it's in the center now if you hold alt and left-click on an axis you can move it out like that you can move the object around and we're just going to create a very small kind of playground with a few interesting bits so let's choose the five hundred plus five actually now let's choose the 400 by 300 well that's nice all these props of course were designed to snap which is nice put that on there we're probably going to modify this more and more as we go through our series but it's nice to have something to look at rather than just a gray scene because we're going to be adding materials and I want to show you guys how to add those to the scene so if you're a bit more of an advanced user then a lot of what we've discussed here might not apply to you but I want to I really wanted to put this out for people who hadn't done any of this stuff before much hasn't haven't had experience heading up there and controllers and stuff like that so I just want to create a cool little section down here that's a bit cut off so let's like to leave drag that over there all right let's track these remember holding alt and left clicking press e rotate then left-click and drag alright then I should be able to select four of these hold out do a master rotate and just put these into place cool flick these two and let's get out player controller and let's just set this up really quickly so click air click + type in environment we're going to click floor shift click to here distract those into environments we're going to get the other walls and check them in there we're going to get our play a start and put it somewhere back here we're then going to adjust our light source so the shadows aren't too harsh ok we're going to also really quickly I'm going to add a section out here and let's graph we have some shapes as well do we have actually we'll do that next video we'll go back to architecture and so get a pillow I just want to create something where we can test out jump we're actually going to scale this pillow a little bit so something a little platform a challenge if you want to test your jump or if you if you have the Genji thing we did you can do some jump and - just a really simple little setup okay now hit build build lighting only will add some materials so once this is built we're going to add some materials in which would be nice we'll just put these back into the environment and the last thing we want to do as I just mentioned going to materials you've got a lot of cool instances here feel free to do whatever you like I'm going to type in the floor and get all these floor actors you'll notice there's a mesh here and let's see see what we get so what's this look like marble floor bricks yeah bricks cool then we'll get our wall and we can get something like that or make something like this we'll stick to um sings it like that now I play and now we have a little scene that we can mess around with jump in you can test that out jump and now we have our own little playground for all our mechanics for future episodes and you can modify this to look however you like I could spend forever here just making this look a bit better actually what's the name of the skin floor I just noticed one I like a good battle let's go to display two materials check that in there yeah that looks much nicer and I'm not not too into this wall so really quickly modify this wall it just looks a bit dull isn't what this now awesome that's good so this is going to be our playground for all future episodes from episode episode we might modify this you don't have to have the exact same setup as I do of course I just thought it'd be fun to do something like this really quickly with you for those who aren't super aware of the editor tools so now you've got your own sauce person movement you've got your game-mode you've got jump your levels set up and now you can go and have fun setting up this level and you can have fun in preparation for the next let's create video so thank you all so much for watching I was beyond over whelmed and overjoyed at the response of the other one so it's going to be good to get these out and see the response from people and thank you all for just watching my videos and checking out my channel because my original goal this year was to get 2000 subscribers and now I'm close to 5000 it's craziness anyway thanks again I hope this was useful I hope you're excited for the future of the series and remember to shoot what is important to you because impossible is just a mindset I'll see you in the next video
Info
Channel: Matthew Palaje
Views: 146,918
Rating: undefined out of 5
Keywords: Unreal Engine 4, UE4, Unreal Engine 4 blueprints, UE4 blueprints tutorial, Matthew Palaje, learn blueprints, let's create, FPS controller unreal engine 4, FPS controller blueprints, tutorial, blueprints, learn unreal engine 4, unreal engine 4 first person, blueprints first person, unreal engine 4 level design, game development tutorial, indie game development, first person blueprint, FPS controller tutorial, blueprints fps
Id: GbhKmFIQtvU
Channel Id: undefined
Length: 21min 9sec (1269 seconds)
Published: Fri Apr 14 2017
Related Videos
Note
Please note that this website is currently a work in progress! Lots of interesting data and statistics to come.