Unity BEGINNER FPS Game Tutorial Part 1 - Getting Started! (No Coding Required!)

Video Statistics and Information

Video
Captions Word Cloud
Reddit Comments
Captions
what's up guys justin here with the realtimeessentials.com so this series we're going to talk about how to create your first first person shooter game inside of unity so let's go ahead and just jump into it so what you want to do is you want to start by opening up the unity hub the unity hub is going to allow us to create a new project and when you create a new project all you're going to do is you want to make sure that you have an install of unity in here just pick one of the lts the long term support versions if you don't have one by clicking on add but then what we want to do is we want to click on new to add a new project and in this case we want to use one of the templates that's already in here we want to use the fps micro game and in this series we're going to build on the fps micro game so we'll create our first game but then we're going to talk about other things like how to add custom levels how to add custom weapons other things like that to make the game your own so this is a great place to start if you've never created a first person shooter game before so what we want to do is we just want to click on this and we just want to name this first person shooter game we want to click the button for create that's going to take this and it's going to create a new project based on that template all right and so when you first load this up it's going to give you the option to either load a scene or load tutorials the tutorials are a great place to get started and it'll walk you through this step by step we're actually going to load the scene and we're going to do something similar to the tutorials in this video but i actually want to walk you through it step by step so you can actually see all of the steps but you can also load the tutorials as well i'm going to start by clicking the button for load scene and so what that's going to do is that's going to load a scene inside of your viewport right here so if you fly around and look notice how it already has a level that's pre-built so it's got different walls around it as well as it already has enemies added into it so it's got these enemy hoverbots right here and what's going to happen is if you load this they're actually going to follow follow you around and shoot at you and you're going to shoot back and that's basically going to be the game so it's got multiple different areas in here so there's another enemy over here so this is kind of a pre-built level and all you have to do to start is just click on the play button right here and so when you click on the play button that's going to drop you into the game and notice how this is pre-built where you can shoot inside of your scene so you can use the w a s and d keys in order to fly around if you walk up to the enemies notice how they're going to find you and then come after you and you can shoot them and you can kill them using the gun that's already in here so that's the basics for this and so you can get out of that at any time by hitting the escape key notice how now my mouse will let me kind of move around in here you can then turn this off by clicking on the play button again and then you'll get back into the overall view where you can start editing things inside of your scene and so now what we want to do is we want to change some things about the way our game works so when we hit play for example notice how when we jump so when i hit the space key you jump up to a certain height right so in this case if i jump up i get about level with this little uh this little icon on the wall right here so however if i was to get out of this and then go in and click on my player right here this is the player item that basically makes up who you are it's the player controller in the game you'll notice how there's different things about that that you can change so for example you can adjust things like the gravity down force that's going to affect how high you can jump because it's going to affect how high or how hard gravity pulls you back to the ground there's also options in here for your maximum speed so you can make yourself go faster by changing this speed right here as well as how fast um as well as how fast you rotate so there's some other interesting things in here as well which we can pay a little bit of attention to i don't want to go too far into the weeds but for example see right here the kill height um the kill height basically means at what height does the player die instantly when they fall off the map so if you were to run through here for example like this and then turn right and jump off the map notice how when you get to a height of negative 50 then you're going to die and then it's going to take you to a menu right here where you can decide to play again or go back to the main menu and so this is a beginner tutorial i don't want to get into scripts or anything like that but you can go in here and view the script behind the character controller this is basically going to be the code that's making the controller do what it does so you can see how there's a lot of different things that are defined in here and a lot of these things are set by values that we set in our actual inputs on the right hand side of the page so don't worry too much about this for right now we're not going to get heavily into the code in this series but in the future we can definitely take a look at these things but it's important for you to understand what the back end of all of this is at least so that you have an idea of how everything is coming together in your game so in this case for example let's say we wanted to make our character faster and jump higher so what we could do is we could change our gravity to something like 12 and then we could also set our max speed on ground to be something like 20 and then if we click on play right here what's going to happen is we're going to be able to jump higher so notice how right now if i jump i'm getting up above this little thing on the wall right here so i'm getting up higher than that because we set our jump height to be higher by turning our gravity down and notice how our character can move faster on the screen as well because we turn that speed up so we can use this in order to adjust the way that the game feels and then in the future what we could do too is we could set this game up where there's different power-ups that affect things like the gravity for a certain amount of time so that should give you kind of an idea of how your controller is set up in this game so now let's talk a little bit about how to add a room to this game so we're gonna fly out a little bit and look at this uh look at this scene so right now they've got this set up where you've got this big room right here you've got another room around here then you've got a door that goes kind of to nowhere right so there's nothing really in here at the moment what we can do is we can add different prefabs to our scene in order to add to the overall level that we can play in in this video we're going to talk about adding prefabs that come with the fps shooter minigame but in the future we'll also talk about creating a level in an external program like a sketchup or a blender or whatever you use for 3d modeling and then bringing that into unity as its own level so that's going to be a part of this series in the future so make sure you stick around for that but for now let's go ahead let's add a room to this let's go ahead and let's add to our level right here and so we want to do is we want to go into the fps folder that gets brought in when we import the fps shooter template but then we want to go into the prefabs folder the prefabs is going to contain all of the things that are pre-built that you can drag into your game so in this case we want to go into the level folder and notice how there's a lot of different things in here so things like pre-built rooms so there's the alter room there's a small and medium room as well as things like if we were to go into our main level things like different pre-built walls that are in here or if we just wanted to go into the walls section there's actual walls that we could drag in here as well so for simplicity sake what i want to do is i want to drag a room in and in this case let's go ahead and the tutorial originally tells us to add the the tutorial tells us to add the alter room what i'm going to do is i'm going to go into the main level under section 1 and i'm just going to add the observatory room right here so i'm going to drag that into my scene notice how when i drag that into my scene that autumn that gets placed like this so it's being placed as a 3d object in here and one thing to note about that is when you first drag that into your scene notice how it just comes into the main overall scene we want to try to stay organized if possible and so notice how there's different dividers that have been added in here in order to keep things kind of separate well what i want to do is i just want to take this observatory and i'm going to drag it from here down into my level right here and i'm probably just going to put it under this room 0 3. so that way this is contained inside of my overall level right here and so we can adjust this by clicking on it so you can either select it over here or you can just click on it in your scene just make sure that you don't that you pick up the whole thing when you're trying to move it around but what we want to do is we want to move it around and so when you select this you can either click on the buttons up here for move rotate and scale or you can tap the w e and r keys in order to adjust these so for example what we want to do is we want the door into this room to line up with this door right here so i'm just going to select my observatory i'm going to tap the e key to go into the rotate tool i'm going to click and drag this in order to rotate it and so one thing that i like to do is i like to hold the control key because that puts me into a mode where it kind of snaps to different degrees that are in here so i want this to snap right here so that it aligns with this wall so then we're going to use the w key in order to put this back into move mode we're going to move this so that our door aligns with our door over here so we're just going to move this right here and we can kind of fly down here to double check and make sure everything's lining up so you can use the arrows in here to kind of fine adjust this whole thing like this and so we've got this in here right we've added our new level well one thing we need to do is we need to set up our enemy navigation mesh so that it'll pick up that space right because basically what these enemies are doing is they're using a predefined mesh in here to figure out where they can actually move so at the moment for example if i click on this navigation button right here and then i zoom out notice how i've got this blue area in here so this blue area is in my nav mesh so my nav mesh is basically the area where my enemies can navigate so this basically goes through and it figures out where your enemies can go so it also figures out where things like your walls are so if you go into this room right here notice how this is a wall and so the blue area goes around this meaning that the enemies can't go through the walls so what we want to do is because we have this new room in here notice how it's not really a part of the navmesh right now so what we want to do is we want to jump over to the bake function and we just want to click on the button for bake right here and notice how when it does this it pre-bakes the space in here so that your enemies know where they can go so now notice how if you were to jump through the window for example they were to follow you they can't go there because the navigation mesh stops at that point so now if i was to click on play like this and let's say i got one of these to follow me right so i'm going to jump into this room notice how it's chasing me what i want to do is i want to jump through this window and fly out here well notice how it can't follow me because that navigation mesh has set that those walls are something that it can't go through so updating that nav mesh is really important because otherwise all of your enemies are just going to fly through the walls so i'm going to hit the escape key i'm going to jump back into my scene view right so now let's say that we wanted to add a new enemy to this level right so we've got one in here right now well what i want to do is i want to go into my prefabs and notice how there are prefabs in here for different enemies so if i click on this notice how there's prefabs in here for the enemy hoverbot and the enemy turret so what we could do if we wanted another hoverbot in here for example let's say we wanted to be sneaky and put him in the corner we could just drag this new enemy in here just like this and this enemy hoverbot is already built um so that it can take advantage of things like the navigation mesh it's already got all the scripts built in here everything like that including like my attack stop distance and everything else that's associated with that things like health all that's already pre-built in here so now if i was to click on play and then walk into that room like this notice how that enemy picks up and sees me it chases me you can shoot it in order to kill it it'll drop a health pick up so these things are already built in this level and so what that means is that means that we can really quickly drag new enemies into the game when we're playing it or we can drag new enemies into the game in order to make the game more interesting you can also move these around just like you can the other prefabs so you can place where this starts off you can adjust all of those different things again let's try to remember to keep that in our enemies section right here and so currently this level is looking a little bit gray so let's add some materials in here and so the way that we can do that is first off and probably the most that we're going to get into in this video is notice how right now the walls and the floors have different materials applied to them so if you click on like the individual objects that are in here so for example this floor object notice that it has a floor gray material so you can find the materials that are in here by going into the art folder under materials and then under level and so notice how those materials are already in here and these objects are referencing back to them so what that means is that means that let's say we wanted to change our wall colors so for example this wall gray if we wanted that to be a different color we could come in here and we could adjust the albedo of our wall notice how when we adjust the albedo of our wall the color of the wall is changing so if we wanted this to be like a blue level for example we could set our lighter blue to be this material right here and then our wall dark gray we could set to be a darker blue material like this right here so we can use this in order to quickly set up materials inside of our level so now we've got this set up where we've been able to adjust the color we've added enemies now let's go into our prefabs folder notice how there's a pickups folder in here and so the pickups folder what that's going to do is that's going to contain things that the character can walk over and add to their inventory so for example there's a launcher in here that we can drag into our scene so let's say that we were to put the launcher in this room right here we're just going to drag the pickup in here and place it right here so then if we click on play and then we run into that room and we walk over that launcher like this notice how that gets added to our inventory we can scroll our mouse up and down like this there we go we can scroll our mouse up and down in order to change between the different guns so i can also tap the one and two keys in order to select the different guns but notice how this one acts in a different way where you can charge it up and then you can launch it and it has kind of an explosion so this has been set up where you can have multiple guns in here and the prefabs are already set up or you can walk over them and so you can also go to the unity asset store and there are different assets that you can download some are paid and some are free for this micro game so if you want to add like more guns or customizable bosses or other things like that there are things that you can download from the unity asset store and then you can import them into unity so what that means is that means that this is kind of a modular thing that you can build on top of we can talk more about adding assets in a future video all right so now what we want to do is we want to export this to a standalone webgl project so what that means is that basically means that we're going to export this to a web page so that you can load and play this inside of a web browser so this is basically how you would get your game out there so other people could play it so what we want to do is we're going to look for the publish option right here then we're going to click on the option for web gl project we want to click on get started so one thing to note about this is when you add a new version of unity so whatever version you bring in for to click on next you want to make sure that you've added the webgl build support to that version so if you don't have that then this is going to tell you that you need to install it which should work fine if you've installed this through the unity hub and so if you have installed this through the unity hub you can click on this and you can click on the option for add modules and you can find that webgl module click on it and then click on done in order to add this to your install but what we want to do is we're going to click the button for get started so we're going to click on the option for build and publish it's going to ask if we want to switch to it and we're going to say yes and then it's going to ask us where we want to save this build so in this case it's just going to create a webgl builds folder in your project folder so i'm just going to click on the button select and let it do this and what it's going to do is it's going to take this and it's actually going to build it and put it in that folder so then it's going to build this and it's going to upload it to unity's website all right so then that's going to upload your game to unity play notice how you can add a thumbnail in here um in order to uh make the game kind of stand out let people know what it's all about that kind of thing you can also rename this and add a description down below so people can see what your game is about and so now you can see how this gets uploaded up here you can name this and you can click on save and so notice how that's now going to show up in your list and if you want to play the game you can click on the play button right here and so now if you click in here you can actually play your game so notice how all of your color changes in here are reflected and if we were to go over here to get our gun pick up right here notice how that shows up in here as well and notice how you can also share your game by clicking on the share button right here and just copy pasting this then people can come in here and actually play the game so that is the basics of starting with the fps minigame we are going to continue in this series creating things like custom levels bringing in our own weapons other things like that so we're going to get a lot more in depth on the way this works i would love to have you along for the ride so make sure you click that subscribe button down below i will also link to that playlist on this page so as videos get added you can come back and check those out but leave a comment below let me know what you thought what you'd like to hear about i just love having that conversation with you guys as always thank you so much for taking the time to watch this and i will catch you in the next video thanks guys
Info
Channel: The RealTime Essentials
Views: 84
Rating: undefined out of 5
Keywords: unity, unity software, unity 3d, unity 2020, unity 2021, unity fps, unity fps tutorial, unity first person shooter tutorial, unity FPS beginner tutorial, unity FPS minigame, unity fps minigame tutorial, unity fps minigame
Id: W_Fpr5jhO5E
Channel Id: undefined
Length: 19min 58sec (1198 seconds)
Published: Tue Dec 14 2021
Related Videos
Note
Please note that this website is currently a work in progress! Lots of interesting data and statistics to come.