How to make a Video Game in Unity - BASICS (E01)

Video Statistics and Information

Video
Captions Word Cloud
Reddit Comments
Captions
So here's the step by step guide on getting started with your first video game. What you see on the screen now is what we're going to be making through this miniseries. It's really simple and Arcad(ey) but it's always easy to add more gameplay elements and cooler graphics at a later point. Right now, let's just jump into it. Let's begin by installing unity. If you've already done so you can just skip ahead in the video. First we need to go to unity3d.com When we're here, we're going to click "Get unity now." And we can see all of the different versions of unity. Unless you're a really experienced developer and working in a team. I definitely just recommend the personal version you can see that it comes with all engine features all platforms Updates, and it's Solely royalty-free So you can use it even to create commercial games the other stuff here is mostly some in the cloud Features and of course the ability to customize your splash screen So let's go ahead and hit download now let's also download the installer And it should be very similar on both windows and Mac go ahead and open the file You just download it so that guess and then we can just skip through the installer I'm going to choose 64-bit if you want a newer computer. You should do the same [and] this here is really neat This is our shoot to customize what parts of unity that you want to [download] because unity might be fairly large I recommend you download unity the documentation the standard assets if you're on the windows definitely check out Microsoft visual Studio tools for unity this will give you a much better text editor Then you can of course choose the platforms that you want to export to I'm just going to select Mac and web Pl We'll just go next choose the folder to install to and it's going to download unity and install for you Let's take a while. Let's hit finish so you can see I'm using genetic [5.5] Which is currently the newest version, but don't worry unity rarely changes things really dramatically so now we can just hit new to create a new project and a unity project is basically just a place to host all of Our code and acid, it's pretty much our entire game before you build it Let's give it a name and here. You can decide whether you want to build a 3D or 2D game however This is pretty much Just [going] to change the few settings inside of unity that we can change at a later point really really easily so this decision here Doesn't matter too much for now. Let's [just] keep that 3D Let's pick a location for a project and hit create So is what unity looks like right when you open it up, you'll notice that I have a dark skin for unity That's because I'm using a paid version, but other than the color of the editor That's not going to make any difference [throughout] the videos, so let's begin by exploring the user interface, so in the Middle here We have this scene view you can use the mouse wheel to zoom in and out you can use the middle mouse button To pan around and if we hold down alt and left-click we can then pivot around the center of our view over here We have the hierarchy this displays all the different game objects that we have in our scene You can see here our scene is currently untitled and it has two game objects the main camera [and] the Directional light notice that when I click on an object say the main camera the inspector will display Properties for that up here each one of these collapsible things here are called components components are what makes objects do different things But we'll get into that in a second you also have the project panel down [here] which shows all of our different game assets that We can then drag into our scene making them [appear] [in] the hierarchy you can totally rearrange Unity in any way that you would like and drag around panels and really go creative with this But remember you can always go to the top right corner and select Default and it's going to reopen to the default layout and any window you don't already have open you can go to window and select It from here, so let's start building our game first off We want to create a ground plane for a player [to] stand on to do that Let's go over to the Hierarchy [right] click You can also go [into] create and select 3D objects keep this spawns a new cube into our scene again We can use the movement controls to have a look at it We can always click the focus on it by hovering over the scene view Selecting it and hitting f now the cube currently is somewhere in our scene [and] it's really hard to get a look at where so what we'll do is Just go over to the transform here, right click and hit reset and that just centers it you can see the position [is] now We're on the x 0 and the y and so you're on the set and gives it a scale of one by one by one Again [hit] f to focus on it So if we go into a game view we can now see our cube through our camera if we want we can take our game View here and dock it to the right so that we can see both our scene and the game view at the same time then We can take our camera here, and we can readjust its position and you can see that updating in real time I'm just going to press ctrl z to undo that and then going to select the cube and scale it up Let's give it a scale of 15 on the x we keep it at 1 on the y and give it say 100 on the z if we zoom out now we can see just how huge this ground plane We can then go and rename it to ground and we can simply drag on the blue arrow Here to move it over something like that [just] so it starts about at the same point as our camera, then let's create another object So [right-click] go 3d object and then cube again let's reset the transform so it's centered on the scene We can then drag on this green arrow to move it up [let's] again hit f to focus on it, and we can see that We now have [our] new Cube here standing on the ground this cube is going to be a player So let's go ahead and rename him to player and it's also make him a bit more visible because right now everything is pretty boring White to do that We need to assign a material to our player And we create a new material in the project panel let's right click down [here] Go create and then material will name this material our player and then matt foreign material, but that's optional that's it enter now We can adjust different properties on this material stuff like how Metallic it should be the smoothness of the material and the color up here So we'll make this some kind of bright [red] and what we can do is then simply drag our player [matte]? Onto our Cube And you can see it Updating in real-time [so] simply let go and it's applied and any changes that we now make to this material are going to update For our player. I think our camera is a bit far [away], so let's also select our camera and move it a bit closer Again, we can move it over by simply dragging on this arrow Move it up a little bit and that looks a lot better So now if we were [to] hit play and actually run our game not much happens That's mostly because we haven't done any [programming] yet, and so we can't really control the player But we also need to add some physics into a game right now if we exit play mode take our player Drag him up here, and hit play again. He's just [going] to float in the air He's not falling down [the] reason why is that we need to tell this game object to interact with the unity physics system to do That we go out of play mode and add a new component in our case. We want to add the physics Rigidbody component Now when we hit play we should see that our cube falls to the ground and indeed It does right now it falls in a bit boring way So let's try and rotate our cube a bit to make [it] more interesting to do that We switch to the rotation tool notice how all of the different tools are up here right now. We have the move tool [selected] We can also shift to rotate scale And then this one is [for] manipulating 2D graphics which allows you to easily do all of the different [things] at the same time [you] Can always switch between these really quickly by using? Q w R and t so we're going to press each Rotate and I'm just going to kind of rotate it in a random way here So if we now hit play he's going to fall down and we can now see that he has a lot more Advanced physics applied than we were able to see before so I'm just going to undo that Rotation by pressing control bit and I'm also going to move him down here We can also try duplicating him, so let's press cTrl d to Duplicate let's move this one up and over a bit and see how they [interact] with each other awesome So one really important thing to understand is what is making these objects behave this way and the answer [is] of course Components, so if we now exit out of play mode and select the player here We can see that he has all of these different components the first one is something that you will see on all game objects called the transform component which just keeps track of where the game object is in space, how it's rotated and its size you can see we can adjust all of these and The game object will be adjusted accordingly and also if we go ahead and drag on the game object you will see the transform component Updating the rest of them though are all optional we have the mesh renderer down here Which is responsible for drawing the object on the screen then we go ahead and disable that it's actually going to disappear It's still in here You can see it's still in the hierarchy and it still has this green box, and we can move it around But until we enable the mesh renderer It's not going to be visible then of course we have the box collider Without this we wouldn't be able to collide with [all] the objects if I go ahead and disable the box collider And then hit play this should just fall [through] the ground But if we then go ahead and re-enable the box collider you can see that It's now able to Collide with everything so remember to get realistic physics We both need a collider and a rigidbody and in order to see it. We need a mesh renderer I of course skip the mesh filter up here. That's not because it's Super advanced It's just that this is only responsible for a very simple thing and that is choosing the [shape] of object right now You can see it has two cube selected. We can easily go in here and change it so we simply click on the little bowl here then we can change it to a capsule a Cylinder a plane a sphere and so on you will notice that it's distorted, but that's just because we messed around with the scale so we Change that to 1 and you will notice now that It's a sphere of course a box collider is still a box so if we want this to behave like a Few years We'll need to remove the box Collider So [right-click] [a] remove component and instead add a sphere Collider and notice how I'm just using search here that just makes things a lot easier [so] let's just [enter] that and you can see now that it has the sphere collider So if we go ahead, and hit play it acts like a sphere And this is of course more noticeable if we move it over So that we can see it hitting the box and it's going to go and roll off our ground plane Another thing is you can also adjust values while [plane] we could take our player here And we're still playing and move them around it might be a bit buggy sometimes when using the physics system But we are able to do it We can even go in here and say disable the ground plane [or] three different stuff like that But just know that any Adjustment that you make while in the game and running are going to go back as soon as you quit playing so make sure not To do any important adjustments while playing or at least remember your settings [oils] You're just going to have lost progress, so the final thing I wanted to do is just delete the [bowl] here And maybe make this a bit prettier by changing our [sky] [box] to do that We go and select our main camera and as the [skybox] here we're going to change it to Solid color and let's make the color here a very wide grey not the most exciting thing in the world But I think it looks pretty simplistic and cold by the way the way I just maximize the game view here is something you're going to see me do a lot of times That's by hitting shift space finally to save your game We can go ahead and hit [cTrl] s or command [s] if you're on the Mac or go to file/save Seems that we need to name our seen something and seems in unity are basically just Levels so we'll just go ahead and call this one level one and Hit save you can see now that the scene appears down here in the project panel if we had multiple scenes We would be able to shift between them by simply double-clicking to load that level up So that was pretty much all of the handy tips that I could fit into this video I know some things are probably really confusing but really the best way for you to learn some of this stuff is by just messing Around with it yourself and then of course in the next video We'll delve into some actual programming that was pretty much it for this video hit the subscribe button to be notified The new video comes out I upload Sundays and Wednesdays [and] of course if you're a fan of the channel you can always support me over at Patreon Patreon calm [Stash] [brackets] So thanks for watching and I will see you in the next video Thanks to all the awesome patreon supporters who donated in December and a special thanks to Sultan [Al] [sharif] [Derrick] James Kirk [Face] Tamara phi James Callaghan Robert Barnum and Jason Lotito if you want to become a patron yourself you can do so at patreon.com slash [bracket]
Info
Channel: Brackeys
Views: 8,166,783
Rating: undefined out of 5
Keywords: brackeys, unity, unity3d, materials, beginner, easy, how, to, howto, learn, course, series, tutorial, tutorials, game, development, develop, games, programming, coding, basic, basics, C#, video game, first, material, physics, interface, navigating, noob, guide, introduction
Id: IlKaB1etrik
Channel Id: undefined
Length: 11min 25sec (685 seconds)
Published: Wed Jan 25 2017
Related Videos
Note
Please note that this website is currently a work in progress! Lots of interesting data and statistics to come.