Open up Unity Hub.
In the top right you can see new projects.
So just click there and we're going to choose unity six.
In the top you can see editor version.
So I'm going to choose a unity six which is uh you can see the version is 6000.0. 40F1.
So I'm using this one and we're going to choose a 2D template.
So I'm going to choose this 2D built in render pipeline.
You can go with this universal 2D as well.
Uh it doesn't need to be this one.
And if you don't have this 2D built in render pipeline or universal 2D, then scroll down to the bottom.
You can see download.
So in the right section you can see download.
So just click there in order to download that.
And after uh doing that make sure you just select that 2D.
Or you can just go with universal 2D as well.
But I'm going to choose this 2D built in render pipeline.
And after doing that in the bottom right, we can see we have to name the project.
So I'm going to call it something like unity six or 2D endless endless runner runner for of in Unity
six with unity six, unity six, something like you can name it.
It's basically totally up to you what you want to name it.
And in the bottom right you can see the location where you want to save the project.
In order to save a location, just click on this folder icon and you can choose a location where you
want to save your project.
I'm going to live with this local disk E so after doing that click on this create project in the bottom
right.
And it's going to create our project or project right away.
And unity just gonna take some few minutes in order to, uh, load up all of the necessary things that
we need to make our game.
So just wait for to unity.
Just template unity.
Just creating our template.
So it's going to take a few moments for creating that.
And I'm going to see you once this unity are loaded up.
As as you can see unity just loaded up.
and if your layout seem a little bit different, then you can arrange like this.
Or you can just leave it.
And I just like this.
So in this way.
So that's why I have done you can toggle it any tab you are you want something like this animation tab
I can toggle it in the top.
I can toggle it in the bottom in the left side or sorry left sidebar as well.
And I'm going to close this tab.
And let's suppose you just lost any tab.
Let's suppose this console tab.
If I just right click on it and then click on this console tab.
As you can see, as soon as we click it's gone.
So what we basically have to do to get it or to restore that we need to move over to window in the top.
Then scroll down says general and you can find the tab which you recently lost.
So in my case this console.
So I'm going to click there in order to get it and select over here not here.
So you can just move it anywhere you want.
And if you want to toggle it.
This tap something like in the bottom right, left or in wherever you want.
Then select this and toggle it down.
Or you can toggle it anywhere you want.
And I'm going to move it something over here and this is fine.
And if you just want it default, if you just mess with unity user face interface, then you can go
always top top right.
You can see layout in the top right.
So just click there and then click on this default in order to set it default.
But I'm gonna like this way.
So I'm going to just leave it in this way.
So let's uh explore one by one.
Uh, this uh tabs.
So we have firstly this scene view.
Scene view.
You can think of it, this is our stage where we need to perform, uh, where we need to drag all of
the sprites as a sprite in order to perform or in order to, uh, play our game.
So this is our stage, state and we have only a main camera.
And this camera is like shooting our game or as like movie.
And the game will be broadcast in this game view, you can see in the left bar you're gonna have in
somewhere else.
So you can just get that by moving over to window in the top, then general, and you can just get the
tab.
So in my case you can see in the second position we have the game tab.
And you can also see the shortcut key in the right section which is control plus two.
So if you just click uh sorry.
If you just press down Control Plus two it's going to bring up Game View immediately.
So the game just gonna be broadcast over here.
Or you can simply say the final result we will see in this game view.
And we also have a project tab in the left side.
And you're gonna have it in the left side or left bar.
So you can just take that.
And in this project app we need to track all of the assets.
Assets basically are those things which we use to make our game, such as musics, sprites or icons,
buttons, anything like that.
Sprites, collecting the coins, sounds.
All of these things call our assets, and we need to drag it in this assets folder.
And we have hierarchy over here.
As you can see in this hierarchy, we can create a game object and we can play around with properties
of those game objects.
Or you can simply say the game objects are actors which gonna play our game.
And in the hierarchy we only have the main camera.
And as soon as we select our main camera, we can see a Inspector tab.
Pop pops up in the right side and we can inspect about this main camera.
We can see the properties of this main camera.
So this main camera has a component called transform as you can see.
And this transform is responsible for position, rotation and scale.
As you can see, and this position has x axis.
So the horizontal is going to be the x axis.
And the vertical will be the x y axis and the depth or in the depth just going to be the z axis.
And it also has rotation in the x y and the z.
So let's create an empty game object first to just get it in more.
So let's go to hierarchy.
So you can just right click.
Or you can click on this plus icon in order to create an empty game object.
So I'm going to right click on this hierarchy.
And in over here you can see create an empty game object and the shortcut key.
You can see in the right section which is Ctrl Shift Plus.
And so we can just click there in order to create the game object.
And as soon as we click we can see a game object lying in our hierarchy.
And if we select this game object then move over to Inspector.
In the right, we can see this game object has a component called transform which is responsible for
position.
So this game object only exists in this 3D place or in this 2D plane.
You can simply say, and let's suppose you just want to see this game object.
Then we need to attach component.
Component basically are those things which we add to do some specific things.
So if we select our game object and select this move this tools and we can see the tools over here we
have move tool in order to move.
So if we just click there we can see we can move this game object anywhere we want.
And we can scroll our mouse in order to zoom in or zoom out.
And we also have this rotation tool.
You can rotate the game object as well and you can scale the game object.
And we have tool.
But the problem is that we not able to see our game object in order to see this object, we need to
attach a component and it's called sprite renderer.
So you need to select the GameObject first in the hierarchy.
Then go over to Inspector.
Then click on this add component and you need to attach a component called Sprite Renderer.
So just click on this card over here and then move over to this renderer in the bottom.
So you can see over here, scroll a bit.
And then you're going to be able to see this rendering.
And click on this.
In order to attach.
And we need to find a component called Sprite Renderer.
So we're going to scroll down a bit and we can see in the bottom a sprite renderer component.
So we can just simply click on that in order to attach the component.
And still we're not able to see this GameObject.
Why?
Because we need to move over to Sprite Renderer.
And we can see sprite and it says sprite basically empty.
So we need to drag sprite of which we want to see.
So in order to see, we also need to drag a sprite over here sprite.
And it says none means empty.
So we need to drag a sprite in this slot.
We can just right click over here here in the right section.
And we're going to attach.
We're gonna drag a sprite called uh square.
And we can just find this over here as well.
So I'm going to type the square.
And we're not able to see.
So we can just click on this icon in the right side in order to see sorry square.
And as soon as we click now we are able to see the game object.
As you can see in the scene view as well as in the game view.
And you can see.
So you need to drag the sprite over here.
Or you can simply just click here in order to choose a sprite that you want to see.
And you can change with any sprite that you would like to go with.
So I'm going to cut this step by now.
And let's suppose I just want to reset the position of this square or anything like that.
I just want to reset.
If you just mess around, then what you have to do, you need to move over to this inspector, then
transform.
Right click on this transform and then click on this reset.
So it's going to reset all of the position in the X to zero.
As you can see in Inspector X to zero, y to zero and the Z to zero.
And also it just set the scale to default to 111 in the x y set also the rotation.
And we can just play our game right right away by now.
So in the top you can see three button.
So the first one is to play our game.
And the second one is to pause our game.
And the third one is to just skip one frame.
So we can just click on this first button which is the play one.
As soon as we're going to play click on this play button.
The game will start right away and we can see the final result in this game view, or the game just
going to be broadcast in this game view.
As you can see, and as soon as the game started, we cannot able to see any change.
We just created a square game object as you can see.
So let's get out of play mode and we're going to add gravity to this game object or to this square game
object.
And in order to add add gravity to this game object we need to attach a component called rigidbody 2D.
But before we do that we're going to select our game object firstly in the hierarchy.
And let's rename this game object to something like player.
So we're going to we can select the GameObject in the hierarchy.
And then we can just right click in the top we can see rename.
So just click there in order to rename or what else you can do.
You can just select the game object.
Then go over to Inspector and you can name the game object as well.
Over here you can name whatever you want.
So I'm going to name it something like player.
So let's call player.
And now we just rename as soon as we just named it player.
It's also changed in this hierarchy as you can see.
So we're going to attach a component.
And it's called Rigidbody 2D in order to attach gravity gravity to our player GameObject.
So select the player GameObject first in the hierarchy.
Then go over to Inspector.
Click on this add component and we're going to add a rigid body 2D.
So we need to move.
We need to scroll a bit and we need to move over to this physics 2D section.
So just click there and we need to find a rigid body 2D over here.
So we're going to scroll down to the bottom.
And we can see rigid body 2D over here as you can see.
So we can just click over click on that component in order to attach or what else you can do.
You can just click on this add component.
And you can find the component by typing the name of the component.
So we're going to add a rigid body 2D.
So we're going to type the component name over here, and if you see anything like that, then you can
just click on this cut over here in the right section in order to cut.
And you can just find the component by typing name of the component.
So we're going to add a rigid body.
So we're going to type uh type this rigid body 2D in order to attach our game component and select this
rigid body 2D not this rigid body because we we are working in a 2D game.
So that's why we need to choose this rigid body 2D instead of this rigid body.
So we're going to click on that in order to attach.
And we can see the properties we have the gravity scale.
We also have the mass.
So we can increase the mass in order to make our gravity intense.
Or we can just play around with this gravity scale as well, uh, in order to increase our gravity.
And now if we just go ahead and then click on this play button in the top, and the game will be start
right off right away.
So just wait.
And as soon as the game gonna start, you will see this game object gonna get fall down.
So as soon as the game starts, our player game object gets fall down.
Why?
Because we added a gravity or sorry, we added this rigid body to the component in order to attach the
gravity.
And we can also see the player game object.
So if we select our player GameObject in the hierarchy, then move over to Inspector Transform.
And in the y axis we can see it just increasing increasing in the negative direction basically down.
So the gravity just became more intense.
You can simply say, and we can just get out of play mode by clicking on this play button in the top
in order to get out of play mode.
So this is the thing that, uh, what you can do and you can just go over to this collision detection
and you can just select it continuous.
So it's gonna continuously detect any collision.
And in this gravity scale, you can just increase the gravity scale as well if you just want to increase
that.
And we have also many things.
And and let's suppose you are somewhere over here in this in view.
As you can see, we're not able to see our game object which is the square.
Or we just rename this as player.
We can see in our hierarchy.
So what you can do you need to select the game object first.
So in our case player in our hierarchy.
And then you can simply press down F in order to focus on that game object.
So if you just mess around something like if, if you anywhere in the scene view, then you can simply
select the game object in the hierarchy and you can press down F in in your keyboard in order to focus
on that game object.
So we can see over here.
And let's suppose you just want to save your project, whatever you have done so far.
So what you have to do, you need to move over to the top left file.
So just click there and then click on the set button in order to save the project and the shortcut key.
You can see in the right section which is Control Plus ls and Control Plus s.
So if we just press Control Plus S, we can save our project right away.
As you can see, as soon as we press Control plus s in this hierarchy, in this sample scene, the star
or that symbol just gone by now, it basically means we just saved our project.
And if you just, uh, let's suppose if you just move this player game object anywhere, as soon as
we move, we can see in the sample scene in our hierarchy is star.
Uh, symbol just came up and we can simply press down Ctrl s in order to save our project.
As soon as we press down Ctrl S, it's gone.
So we can save our project, whatever we have done so far.
So this is cool thing about this.