WEBVTT

00:00.080 --> 00:01.400
Open up Unity Hub.

00:01.400 --> 00:03.760
In the top right you can see new projects.

00:03.760 --> 00:07.520
So just click there and we're going to choose unity six.

00:07.520 --> 00:09.880
In the top you can see editor version.

00:09.880 --> 00:20.200
So I'm going to choose a unity six which is uh you can see the version is 6000.0. 40F1.

00:20.200 --> 00:24.280
So I'm using this one and we're going to choose a 2D template.

00:24.280 --> 00:28.040
So I'm going to choose this 2D built in render pipeline.

00:28.040 --> 00:31.280
You can go with this universal 2D as well.

00:31.600 --> 00:33.720
Uh it doesn't need to be this one.

00:33.880 --> 00:40.640
And if you don't have this 2D built in render pipeline or universal 2D, then scroll down to the bottom.

00:40.640 --> 00:42.080
You can see download.

00:42.080 --> 00:44.720
So in the right section you can see download.

00:44.720 --> 00:47.720
So just click there in order to download that.

00:47.720 --> 00:53.040
And after uh doing that make sure you just select that 2D.

00:53.400 --> 00:56.120
Or you can just go with universal 2D as well.

00:56.120 --> 00:59.560
But I'm going to choose this 2D built in render pipeline.

00:59.620 --> 01:05.140
And after doing that in the bottom right, we can see we have to name the project.

01:05.140 --> 01:18.980
So I'm going to call it something like unity six or 2D endless endless runner runner for of in Unity

01:19.020 --> 01:24.260
six with unity six, unity six, something like you can name it.

01:24.260 --> 01:27.500
It's basically totally up to you what you want to name it.

01:27.660 --> 01:32.900
And in the bottom right you can see the location where you want to save the project.

01:32.900 --> 01:39.300
In order to save a location, just click on this folder icon and you can choose a location where you

01:39.300 --> 01:41.100
want to save your project.

01:41.140 --> 01:47.460
I'm going to live with this local disk E so after doing that click on this create project in the bottom

01:47.460 --> 01:47.940
right.

01:48.100 --> 01:52.100
And it's going to create our project or project right away.

01:52.420 --> 02:00.050
And unity just gonna take some few minutes in order to, uh, load up all of the necessary things that

02:00.050 --> 02:02.010
we need to make our game.

02:02.850 --> 02:05.770
So just wait for to unity.

02:06.850 --> 02:08.370
Just template unity.

02:08.370 --> 02:10.170
Just creating our template.

02:10.610 --> 02:14.130
So it's going to take a few moments for creating that.

02:16.450 --> 02:20.890
And I'm going to see you once this unity are loaded up.

02:53.250 --> 02:56.330
As as you can see unity just loaded up.

02:56.710 --> 03:01.790
and if your layout seem a little bit different, then you can arrange like this.

03:01.790 --> 03:03.070
Or you can just leave it.

03:03.310 --> 03:04.990
And I just like this.

03:04.990 --> 03:06.070
So in this way.

03:06.070 --> 03:12.830
So that's why I have done you can toggle it any tab you are you want something like this animation tab

03:12.870 --> 03:14.590
I can toggle it in the top.

03:14.590 --> 03:20.750
I can toggle it in the bottom in the left side or sorry left sidebar as well.

03:21.270 --> 03:23.070
And I'm going to close this tab.

03:23.670 --> 03:25.950
And let's suppose you just lost any tab.

03:25.950 --> 03:27.550
Let's suppose this console tab.

03:27.550 --> 03:30.950
If I just right click on it and then click on this console tab.

03:30.990 --> 03:34.230
As you can see, as soon as we click it's gone.

03:34.230 --> 03:40.750
So what we basically have to do to get it or to restore that we need to move over to window in the top.

03:40.750 --> 03:45.430
Then scroll down says general and you can find the tab which you recently lost.

03:45.430 --> 03:46.830
So in my case this console.

03:46.830 --> 03:51.910
So I'm going to click there in order to get it and select over here not here.

03:51.910 --> 03:54.270
So you can just move it anywhere you want.

03:54.310 --> 03:56.340
And if you want to toggle it.

03:56.340 --> 04:01.700
This tap something like in the bottom right, left or in wherever you want.

04:01.740 --> 04:04.620
Then select this and toggle it down.

04:04.620 --> 04:07.820
Or you can toggle it anywhere you want.

04:07.860 --> 04:11.700
And I'm going to move it something over here and this is fine.

04:11.900 --> 04:20.500
And if you just want it default, if you just mess with unity user face interface, then you can go

04:20.500 --> 04:22.300
always top top right.

04:22.340 --> 04:24.100
You can see layout in the top right.

04:24.100 --> 04:28.700
So just click there and then click on this default in order to set it default.

04:28.700 --> 04:30.100
But I'm gonna like this way.

04:30.100 --> 04:32.580
So I'm going to just leave it in this way.

04:32.980 --> 04:35.220
So let's uh explore one by one.

04:35.380 --> 04:37.020
Uh, this uh tabs.

04:37.020 --> 04:39.020
So we have firstly this scene view.

04:39.220 --> 04:39.860
Scene view.

04:39.980 --> 04:46.260
You can think of it, this is our stage where we need to perform, uh, where we need to drag all of

04:46.260 --> 04:52.780
the sprites as a sprite in order to perform or in order to, uh, play our game.

04:52.780 --> 04:56.600
So this is our stage, state and we have only a main camera.

04:56.600 --> 05:00.920
And this camera is like shooting our game or as like movie.

05:01.120 --> 05:06.960
And the game will be broadcast in this game view, you can see in the left bar you're gonna have in

05:06.960 --> 05:08.200
somewhere else.

05:08.200 --> 05:15.240
So you can just get that by moving over to window in the top, then general, and you can just get the

05:15.240 --> 05:15.520
tab.

05:15.520 --> 05:20.920
So in my case you can see in the second position we have the game tab.

05:20.920 --> 05:25.840
And you can also see the shortcut key in the right section which is control plus two.

05:25.960 --> 05:27.880
So if you just click uh sorry.

05:27.920 --> 05:33.480
If you just press down Control Plus two it's going to bring up Game View immediately.

05:33.480 --> 05:36.680
So the game just gonna be broadcast over here.

05:36.840 --> 05:41.200
Or you can simply say the final result we will see in this game view.

05:41.520 --> 05:45.440
And we also have a project tab in the left side.

05:45.480 --> 05:48.880
And you're gonna have it in the left side or left bar.

05:48.880 --> 05:50.520
So you can just take that.

05:50.720 --> 05:54.630
And in this project app we need to track all of the assets.

05:54.830 --> 06:02.790
Assets basically are those things which we use to make our game, such as musics, sprites or icons,

06:02.790 --> 06:04.550
buttons, anything like that.

06:04.950 --> 06:07.390
Sprites, collecting the coins, sounds.

06:07.390 --> 06:12.670
All of these things call our assets, and we need to drag it in this assets folder.

06:12.670 --> 06:14.870
And we have hierarchy over here.

06:14.870 --> 06:21.390
As you can see in this hierarchy, we can create a game object and we can play around with properties

06:21.390 --> 06:22.790
of those game objects.

06:22.790 --> 06:27.750
Or you can simply say the game objects are actors which gonna play our game.

06:27.990 --> 06:30.670
And in the hierarchy we only have the main camera.

06:30.910 --> 06:36.670
And as soon as we select our main camera, we can see a Inspector tab.

06:36.710 --> 06:42.390
Pop pops up in the right side and we can inspect about this main camera.

06:42.390 --> 06:45.030
We can see the properties of this main camera.

06:45.310 --> 06:49.510
So this main camera has a component called transform as you can see.

06:49.550 --> 06:54.090
And this transform is responsible for position, rotation and scale.

06:54.370 --> 06:59.050
As you can see, and this position has x axis.

06:59.050 --> 07:02.450
So the horizontal is going to be the x axis.

07:02.450 --> 07:09.610
And the vertical will be the x y axis and the depth or in the depth just going to be the z axis.

07:09.610 --> 07:13.210
And it also has rotation in the x y and the z.

07:13.810 --> 07:19.050
So let's create an empty game object first to just get it in more.

07:19.130 --> 07:20.530
So let's go to hierarchy.

07:20.530 --> 07:21.890
So you can just right click.

07:21.890 --> 07:26.450
Or you can click on this plus icon in order to create an empty game object.

07:26.450 --> 07:28.490
So I'm going to right click on this hierarchy.

07:28.930 --> 07:33.650
And in over here you can see create an empty game object and the shortcut key.

07:33.690 --> 07:37.130
You can see in the right section which is Ctrl Shift Plus.

07:37.170 --> 07:41.170
And so we can just click there in order to create the game object.

07:41.330 --> 07:46.090
And as soon as we click we can see a game object lying in our hierarchy.

07:46.330 --> 07:49.570
And if we select this game object then move over to Inspector.

07:49.570 --> 07:56.560
In the right, we can see this game object has a component called transform which is responsible for

07:56.560 --> 07:57.320
position.

07:57.320 --> 08:02.840
So this game object only exists in this 3D place or in this 2D plane.

08:02.840 --> 08:08.000
You can simply say, and let's suppose you just want to see this game object.

08:08.000 --> 08:10.080
Then we need to attach component.

08:10.120 --> 08:15.800
Component basically are those things which we add to do some specific things.

08:15.800 --> 08:22.440
So if we select our game object and select this move this tools and we can see the tools over here we

08:22.440 --> 08:24.520
have move tool in order to move.

08:24.520 --> 08:29.720
So if we just click there we can see we can move this game object anywhere we want.

08:29.760 --> 08:34.800
And we can scroll our mouse in order to zoom in or zoom out.

08:34.800 --> 08:37.720
And we also have this rotation tool.

08:37.760 --> 08:42.360
You can rotate the game object as well and you can scale the game object.

08:42.520 --> 08:44.200
And we have tool.

08:44.240 --> 08:51.580
But the problem is that we not able to see our game object in order to see this object, we need to

08:51.580 --> 08:55.180
attach a component and it's called sprite renderer.

08:55.180 --> 08:58.140
So you need to select the GameObject first in the hierarchy.

08:58.300 --> 08:59.700
Then go over to Inspector.

08:59.740 --> 09:05.180
Then click on this add component and you need to attach a component called Sprite Renderer.

09:05.180 --> 09:11.780
So just click on this card over here and then move over to this renderer in the bottom.

09:11.780 --> 09:14.660
So you can see over here, scroll a bit.

09:14.660 --> 09:17.420
And then you're going to be able to see this rendering.

09:17.820 --> 09:19.260
And click on this.

09:19.300 --> 09:20.780
In order to attach.

09:20.780 --> 09:24.140
And we need to find a component called Sprite Renderer.

09:24.140 --> 09:29.260
So we're going to scroll down a bit and we can see in the bottom a sprite renderer component.

09:29.260 --> 09:33.300
So we can just simply click on that in order to attach the component.

09:33.620 --> 09:36.620
And still we're not able to see this GameObject.

09:36.620 --> 09:37.060
Why?

09:37.100 --> 09:39.780
Because we need to move over to Sprite Renderer.

09:39.780 --> 09:43.940
And we can see sprite and it says sprite basically empty.

09:43.940 --> 09:48.360
So we need to drag sprite of which we want to see.

09:48.480 --> 09:53.000
So in order to see, we also need to drag a sprite over here sprite.

09:53.000 --> 09:55.080
And it says none means empty.

09:55.080 --> 09:57.680
So we need to drag a sprite in this slot.

09:57.880 --> 10:01.920
We can just right click over here here in the right section.

10:02.160 --> 10:03.200
And we're going to attach.

10:03.320 --> 10:06.960
We're gonna drag a sprite called uh square.

10:06.960 --> 10:09.520
And we can just find this over here as well.

10:09.520 --> 10:12.120
So I'm going to type the square.

10:12.280 --> 10:13.840
And we're not able to see.

10:13.840 --> 10:19.600
So we can just click on this icon in the right side in order to see sorry square.

10:19.600 --> 10:24.080
And as soon as we click now we are able to see the game object.

10:24.080 --> 10:28.600
As you can see in the scene view as well as in the game view.

10:29.000 --> 10:30.240
And you can see.

10:30.240 --> 10:32.760
So you need to drag the sprite over here.

10:32.760 --> 10:38.080
Or you can simply just click here in order to choose a sprite that you want to see.

10:38.120 --> 10:42.720
And you can change with any sprite that you would like to go with.

10:42.720 --> 10:44.480
So I'm going to cut this step by now.

10:44.800 --> 10:50.710
And let's suppose I just want to reset the position of this square or anything like that.

10:50.710 --> 10:52.470
I just want to reset.

10:52.470 --> 10:57.950
If you just mess around, then what you have to do, you need to move over to this inspector, then

10:57.950 --> 10:58.750
transform.

10:58.790 --> 11:02.110
Right click on this transform and then click on this reset.

11:02.110 --> 11:05.590
So it's going to reset all of the position in the X to zero.

11:05.630 --> 11:11.070
As you can see in Inspector X to zero, y to zero and the Z to zero.

11:11.550 --> 11:18.510
And also it just set the scale to default to 111 in the x y set also the rotation.

11:19.150 --> 11:23.230
And we can just play our game right right away by now.

11:23.230 --> 11:25.070
So in the top you can see three button.

11:25.070 --> 11:27.590
So the first one is to play our game.

11:27.590 --> 11:30.230
And the second one is to pause our game.

11:30.230 --> 11:33.470
And the third one is to just skip one frame.

11:33.470 --> 11:37.110
So we can just click on this first button which is the play one.

11:37.310 --> 11:40.430
As soon as we're going to play click on this play button.

11:40.470 --> 11:46.650
The game will start right away and we can see the final result in this game view, or the game just

11:46.650 --> 11:48.770
going to be broadcast in this game view.

11:48.810 --> 11:54.330
As you can see, and as soon as the game started, we cannot able to see any change.

11:54.330 --> 11:58.650
We just created a square game object as you can see.

11:58.650 --> 12:05.290
So let's get out of play mode and we're going to add gravity to this game object or to this square game

12:05.330 --> 12:05.930
object.

12:05.930 --> 12:13.450
And in order to add add gravity to this game object we need to attach a component called rigidbody 2D.

12:13.450 --> 12:18.530
But before we do that we're going to select our game object firstly in the hierarchy.

12:18.530 --> 12:21.530
And let's rename this game object to something like player.

12:21.650 --> 12:25.170
So we're going to we can select the GameObject in the hierarchy.

12:25.170 --> 12:28.930
And then we can just right click in the top we can see rename.

12:28.930 --> 12:32.370
So just click there in order to rename or what else you can do.

12:32.410 --> 12:34.210
You can just select the game object.

12:34.210 --> 12:38.010
Then go over to Inspector and you can name the game object as well.

12:38.010 --> 12:41.250
Over here you can name whatever you want.

12:41.290 --> 12:43.370
So I'm going to name it something like player.

12:44.160 --> 12:45.360
So let's call player.

12:45.360 --> 12:49.320
And now we just rename as soon as we just named it player.

12:49.320 --> 12:52.520
It's also changed in this hierarchy as you can see.

12:52.760 --> 12:54.520
So we're going to attach a component.

12:54.520 --> 13:01.520
And it's called Rigidbody 2D in order to attach gravity gravity to our player GameObject.

13:01.520 --> 13:04.280
So select the player GameObject first in the hierarchy.

13:04.440 --> 13:05.840
Then go over to Inspector.

13:05.880 --> 13:10.000
Click on this add component and we're going to add a rigid body 2D.

13:10.000 --> 13:11.000
So we need to move.

13:11.160 --> 13:15.440
We need to scroll a bit and we need to move over to this physics 2D section.

13:15.440 --> 13:20.080
So just click there and we need to find a rigid body 2D over here.

13:20.080 --> 13:22.040
So we're going to scroll down to the bottom.

13:22.320 --> 13:26.880
And we can see rigid body 2D over here as you can see.

13:26.880 --> 13:32.720
So we can just click over click on that component in order to attach or what else you can do.

13:32.760 --> 13:35.000
You can just click on this add component.

13:35.000 --> 13:38.760
And you can find the component by typing the name of the component.

13:38.760 --> 13:40.760
So we're going to add a rigid body 2D.

13:40.760 --> 13:45.860
So we're going to type the component name over here, and if you see anything like that, then you can

13:45.860 --> 13:50.180
just click on this cut over here in the right section in order to cut.

13:50.180 --> 13:54.620
And you can just find the component by typing name of the component.

13:54.620 --> 13:56.380
So we're going to add a rigid body.

13:56.380 --> 14:03.420
So we're going to type uh type this rigid body 2D in order to attach our game component and select this

14:03.420 --> 14:08.980
rigid body 2D not this rigid body because we we are working in a 2D game.

14:08.980 --> 14:13.860
So that's why we need to choose this rigid body 2D instead of this rigid body.

14:14.140 --> 14:16.460
So we're going to click on that in order to attach.

14:16.460 --> 14:19.900
And we can see the properties we have the gravity scale.

14:19.900 --> 14:21.340
We also have the mass.

14:21.340 --> 14:26.180
So we can increase the mass in order to make our gravity intense.

14:26.180 --> 14:33.340
Or we can just play around with this gravity scale as well, uh, in order to increase our gravity.

14:33.340 --> 14:39.300
And now if we just go ahead and then click on this play button in the top, and the game will be start

14:39.340 --> 14:41.410
right off right away.

14:42.170 --> 14:43.330
So just wait.

14:43.330 --> 14:48.130
And as soon as the game gonna start, you will see this game object gonna get fall down.

14:48.130 --> 14:52.130
So as soon as the game starts, our player game object gets fall down.

14:52.130 --> 14:52.570
Why?

14:52.730 --> 14:59.530
Because we added a gravity or sorry, we added this rigid body to the component in order to attach the

14:59.530 --> 15:00.250
gravity.

15:00.490 --> 15:02.970
And we can also see the player game object.

15:02.970 --> 15:08.210
So if we select our player GameObject in the hierarchy, then move over to Inspector Transform.

15:08.210 --> 15:15.130
And in the y axis we can see it just increasing increasing in the negative direction basically down.

15:15.130 --> 15:19.570
So the gravity just became more intense.

15:19.570 --> 15:24.890
You can simply say, and we can just get out of play mode by clicking on this play button in the top

15:24.890 --> 15:27.050
in order to get out of play mode.

15:27.290 --> 15:32.570
So this is the thing that, uh, what you can do and you can just go over to this collision detection

15:32.570 --> 15:35.250
and you can just select it continuous.

15:35.250 --> 15:38.170
So it's gonna continuously detect any collision.

15:38.370 --> 15:44.510
And in this gravity scale, you can just increase the gravity scale as well if you just want to increase

15:44.510 --> 15:44.950
that.

15:45.590 --> 15:48.030
And we have also many things.

15:48.230 --> 15:53.550
And and let's suppose you are somewhere over here in this in view.

15:53.590 --> 15:58.110
As you can see, we're not able to see our game object which is the square.

15:58.230 --> 16:01.230
Or we just rename this as player.

16:01.350 --> 16:03.590
We can see in our hierarchy.

16:03.590 --> 16:07.030
So what you can do you need to select the game object first.

16:07.030 --> 16:09.950
So in our case player in our hierarchy.

16:10.190 --> 16:15.510
And then you can simply press down F in order to focus on that game object.

16:15.510 --> 16:21.710
So if you just mess around something like if, if you anywhere in the scene view, then you can simply

16:21.710 --> 16:28.470
select the game object in the hierarchy and you can press down F in in your keyboard in order to focus

16:28.470 --> 16:29.950
on that game object.

16:29.950 --> 16:31.670
So we can see over here.

16:31.830 --> 16:36.710
And let's suppose you just want to save your project, whatever you have done so far.

16:36.870 --> 16:40.820
So what you have to do, you need to move over to the top left file.

16:40.820 --> 16:46.140
So just click there and then click on the set button in order to save the project and the shortcut key.

16:46.180 --> 16:51.140
You can see in the right section which is Control Plus ls and Control Plus s.

16:51.260 --> 16:56.700
So if we just press Control Plus S, we can save our project right away.

16:56.740 --> 17:03.900
As you can see, as soon as we press Control plus s in this hierarchy, in this sample scene, the star

17:04.020 --> 17:10.220
or that symbol just gone by now, it basically means we just saved our project.

17:10.220 --> 17:16.860
And if you just, uh, let's suppose if you just move this player game object anywhere, as soon as

17:16.900 --> 17:21.420
we move, we can see in the sample scene in our hierarchy is star.

17:21.460 --> 17:27.900
Uh, symbol just came up and we can simply press down Ctrl s in order to save our project.

17:27.900 --> 17:31.060
As soon as we press down Ctrl S, it's gone.

17:31.380 --> 17:35.620
So we can save our project, whatever we have done so far.

17:35.780 --> 17:37.860
So this is cool thing about this.
