WEBVTT

00:00.080 --> 00:03.280
Let's create the tile maps basically, and we're gonna create.

00:03.280 --> 00:06.360
So we're going to get rid of this square ground for now.

00:06.360 --> 00:09.200
So let's select the ground game object in the hierarchy.

00:09.200 --> 00:10.280
Go over to Inspector.

00:10.280 --> 00:14.160
And you can just click over here in order to disable that.

00:14.200 --> 00:18.000
Or you can simply enable as well by clicking there.

00:18.000 --> 00:21.720
So we're just deactivating or we just disabling that.

00:21.720 --> 00:24.520
For now let's create our tile map.

00:24.760 --> 00:29.040
But before we do what we need to do, we need to move over to this hierarchy.

00:29.360 --> 00:32.680
So right click on hierarchy or click on this plus icon.

00:32.680 --> 00:37.200
Then go to 2D objects, then Tile map and then click on this rectangular.

00:37.360 --> 00:39.680
And it's going to create the grid for us.

00:39.680 --> 00:44.520
And if you want to see the grid you can just click over here in the top you can see.

00:44.520 --> 00:46.120
So you need to just click there.

00:46.280 --> 00:54.480
And we can see in the scene view we have a tile palette in the top left corner uh top left corner.

00:54.720 --> 00:57.120
You can have it anywhere something like that.

00:57.520 --> 01:02.410
You're gonna have it in the bottom in the scene view, anywhere in this interview.

01:02.410 --> 01:04.370
So make sure you just find that first.

01:04.370 --> 01:06.890
And then click on this Open Tile palette.

01:07.010 --> 01:10.210
And we are ready to create our tile palette.

01:10.490 --> 01:16.330
So basically we need to create our palette first as you can see create new tile palette.

01:16.330 --> 01:20.530
So just click there and then click on this Create New palette.

01:20.530 --> 01:23.330
And you have to name the palette what you want to name it.

01:23.330 --> 01:25.770
So I'm going to call it something like tile.

01:25.770 --> 01:29.450
And after doing that click on this create button in the bottom right.

01:29.730 --> 01:33.450
And we have to choose a folder where we want to create that.

01:33.450 --> 01:35.610
So I'm going to move over to this assets.

01:35.610 --> 01:38.970
In assets we have animation folder audio prefabs.

01:38.970 --> 01:42.850
So when we create a separate folder for our tile maps.

01:42.850 --> 01:46.930
So just right click there and then go to new and then folder.

01:46.930 --> 01:49.770
And I'm going to name this folder to something like tiles.

01:49.770 --> 01:56.210
So let's call it tiles and double click on it in order to open that up.

01:56.770 --> 02:02.380
And let's click on this select folder in the bottom right we can see and it's going to create the tile

02:02.420 --> 02:03.460
palette right away.

02:03.500 --> 02:09.300
And what we have to do over here, we need to drag the tile set over here.

02:09.300 --> 02:11.740
So we need to drag our tile set here.

02:12.060 --> 02:14.140
So we need to create that first.

02:14.140 --> 02:16.380
So let's click on this card tab for now.

02:16.540 --> 02:20.340
And you're gonna have this open tile palette anywhere in the scene view.

02:20.380 --> 02:22.460
Make sure you just find that first.

02:22.460 --> 02:26.100
So let's move over to our project tab then assets folder.

02:26.100 --> 02:31.260
And then we're going to move over to this sprites folder I have a environment folder.

02:31.260 --> 02:36.900
As you can see in this project tab of course I will have a link in the resources.

02:36.900 --> 02:40.380
You can go and check that out of this assets.

02:40.380 --> 02:43.580
So I'm going to move over to my free folder.

02:43.580 --> 02:46.460
And we can see we have backgrounds and the tiles.

02:46.460 --> 02:48.100
So we're going to select our tiles.

02:48.100 --> 02:51.460
And we have it over here terrain we can see.

02:52.580 --> 02:54.540
So we need to slice individually.

02:54.540 --> 03:01.060
So make sure you select the first uh terrain in your from that folder select that sprite spreadsheet.

03:01.060 --> 03:06.220
Then go over to Inspector and then click on this open Sprite Editor in the Inspector.

03:06.540 --> 03:09.860
As soon as we click, we can see an Sprite Editor tab.

03:09.860 --> 03:10.820
Just open up.

03:10.860 --> 03:12.220
Open it up right away.

03:12.300 --> 03:19.460
So what we need to do, we need to slice individually something like 16 by 16 in the x and y in the

03:19.460 --> 03:19.740
width.

03:19.740 --> 03:21.900
Or you can simply say in the height.

03:21.900 --> 03:23.540
So we need to split that.

03:23.540 --> 03:29.260
So make sure you just go to Inspector in the right and sprite mode to choose multiple and pixel per

03:29.300 --> 03:29.580
unit.

03:29.580 --> 03:34.300
We're going to choose something like 16 in order to make this sprite large in size.

03:34.300 --> 03:37.460
So we're going to make it something like 16 and scroll down.

03:37.460 --> 03:40.260
We need to choose this filter mode to point no filter.

03:40.260 --> 03:40.700
Why?

03:40.860 --> 03:47.260
If you take a closer look by scrolling your mouse in this sprite editor, we can see the sprite just

03:47.260 --> 03:48.820
looks a little bit blurry.

03:48.820 --> 03:53.780
So to get rid of that, we need to choose this filter mode to point filter in the inspector.

03:53.780 --> 03:59.420
And after doing all of these things in the bottom, scroll down and then click on this apply button

03:59.420 --> 04:00.060
in the bottom.

04:00.060 --> 04:02.670
You can see as soon as we click apply.

04:02.710 --> 04:08.670
Now we can see the blurry is gone by now and we are ready to slice individually.

04:08.670 --> 04:11.670
So in the top left Sprite editor tab you can see slice.

04:11.670 --> 04:19.030
So just click there and select automatic to create by cell cell size and go and basically put in the

04:19.070 --> 04:24.750
width x basically means the width something like 16 as we have done in pixel per unit.

04:24.750 --> 04:28.990
And we're going to do the same thing in Y like a square.

04:28.990 --> 04:31.110
So we're going to put 16 by 16.

04:31.110 --> 04:36.350
And after doing that click on this slice button and then click on this apply button in the top right

04:36.350 --> 04:38.190
in Sprite Editor tab.

04:38.430 --> 04:44.070
So as soon as you're going to click on this apply button, it's going to split individually with uh

04:44.110 --> 04:48.030
with uh 16 in the width and 16 in the height.

04:48.350 --> 04:49.830
So we can just go over to.

04:49.870 --> 04:52.910
So I'm going to select my game view once again over here.

04:52.910 --> 04:54.430
And let's go to that sprite sheet.

04:54.430 --> 04:56.110
And let's click on this arrow.

04:56.230 --> 05:00.430
As soon as we click we can see the individual slice by now.

05:00.480 --> 05:02.120
So what we have to do.

05:02.120 --> 05:05.800
So make sure you select the Tile Map GameObject in the hierarchy.

05:06.000 --> 05:10.560
Basically select the grid and then Tile Map and move over to this scene view.

05:10.560 --> 05:12.720
And then click on this Open Tile palette.

05:12.720 --> 05:15.040
You're going to have it anywhere in the scene view.

05:15.040 --> 05:18.600
So I'm just uh, just explaining it one more time.

05:18.600 --> 05:22.120
So you need to find that so I can see I have it over here.

05:22.120 --> 05:26.640
So just click on this Open Tile palette in order to open the tile palette.

05:26.640 --> 05:29.160
And now we need to drag the sprite over here.

05:29.160 --> 05:33.120
As you can see it says drag tile sprite or texture.

05:33.120 --> 05:33.880
So we split.

05:33.880 --> 05:36.120
So we're going to select our sprite sheet.

05:36.120 --> 05:42.880
So make sure you select the whole sprite sheet which we recently slice it individually by 16 by 16.

05:43.080 --> 05:49.840
So make sure you select the whole not the by clicking this arrow and then individual or individual ones.

05:49.840 --> 05:55.680
Instead, you need to select the whole sprite sheet and then drag it over to this tile palette over

05:55.680 --> 05:56.160
here.

05:56.160 --> 06:01.530
As you can see, and we need to choose a folder where we just want to drag them.

06:01.530 --> 06:05.170
So we're going to move over to these assets and an assets folder.

06:05.170 --> 06:07.970
As you can see we created a styles folder.

06:07.970 --> 06:09.370
So we're going to select that folder.

06:09.370 --> 06:11.490
Let's click on this select folder.

06:11.490 --> 06:14.210
As soon as you're going to select all of the sprites.

06:14.250 --> 06:17.730
Just going to be dragged over here in this style palette.

06:18.770 --> 06:20.810
So just wait a little moment.

06:22.850 --> 06:27.050
And now we can see all of our tile by scrolling our mouse.

06:27.050 --> 06:34.810
And you can just make this type bigger as well by just extending in the width as well as in the height.

06:34.810 --> 06:40.530
So I'm going to make it a little bit bigger to be able to or see or notice.

06:40.730 --> 06:46.970
So what we're going to do now if we select our create, firstly we're going to make an empty game object.

06:46.970 --> 06:49.850
And that game object is just going to be a parent one.

06:49.850 --> 06:54.970
And then we're going to make this crate or this tiles a child of that game object.

06:54.970 --> 06:56.410
So let me do that.

06:56.410 --> 07:00.890
So basically make sure you just go to hierarchy right click or hit this plus icon.

07:00.890 --> 07:06.250
Then create an empty game object and we're going to call this game object to something like round one.

07:06.250 --> 07:10.850
So let's call it round underscore one and go over to Inspector in the right.

07:10.850 --> 07:14.730
And then right click on this transform and click on this reset.

07:14.730 --> 07:17.170
So it's going to reset the position into center.

07:17.170 --> 07:18.570
And then select this arrow.

07:18.930 --> 07:19.570
Uh sorry.

07:19.610 --> 07:22.610
Select this tool from in this from this in view.

07:22.930 --> 07:27.690
And if you want to choose an icon you can just go over to this inspector.

07:27.730 --> 07:31.050
Click on this box and you can choose an icon as well.

07:31.050 --> 07:34.050
So I'm going to select this yellow one something like that.

07:34.050 --> 07:39.010
And now we are able to see I'm going to drag my player game object a little bit over here.

07:39.010 --> 07:39.970
Something like that.

07:39.970 --> 07:43.130
So I'm going to select my Game player game object in the hierarchy.

07:43.250 --> 07:47.090
And let's drag it somewhere over here in the top left side.

07:47.330 --> 07:49.610
And we are ready to do so.

07:49.610 --> 07:54.770
You can just scroll your mouse in order to zoom in or zoom out.

07:54.770 --> 07:59.170
So why we created this, uh, ground underscore one game object first?

07:59.170 --> 08:06.660
Because that at this point, or this position or this game object is just going to represent the first

08:06.700 --> 08:11.300
or the, uh, you can say start position of that crown.

08:11.300 --> 08:12.140
So that's why.

08:12.140 --> 08:15.140
And now what we're gonna do, we're going to select our crown.

08:15.140 --> 08:17.980
So select the crown and drag it on top of this crown.

08:18.020 --> 08:20.020
Underscore one game object.

08:20.020 --> 08:27.220
So now if I select my crown underscore one object in the hierarchy and try to move anywhere in the scene

08:27.220 --> 08:29.140
view, you will see this crown game.

08:29.180 --> 08:31.980
A great game object is also moving with it.

08:31.980 --> 08:35.660
So I'm gonna set the position once again to something like zero.

08:36.100 --> 08:37.180
And let's do that.

08:37.180 --> 08:39.900
Let's uh, we are ready to place our tiles.

08:39.900 --> 08:44.140
So what we need to do, we need to just click on that tile palette.

08:44.180 --> 08:48.340
So but before you do, make sure you select the Create Game object in the hierarchy.

08:48.340 --> 08:51.420
Then click on this Open Tile palette in the scene view.

08:51.420 --> 08:53.780
So it's gonna open our tile palette.

08:53.780 --> 08:57.140
And we are ready to place our tiles.

08:57.140 --> 08:58.660
So we're going to click over here.

08:58.660 --> 09:02.990
And we can choose the tile map as well, or we can simply choose the create.

09:04.630 --> 09:08.710
So let's choose that and we are ready to place our tile.

09:08.710 --> 09:12.910
So move over to this Tile palette tab and we're going to place our tile.

09:12.910 --> 09:14.470
So let's see.

09:14.710 --> 09:21.470
You can scroll your mouse and you can just move your mouse in order to look around in this tile palette.

09:21.870 --> 09:25.910
So we are ready to place our tile.

09:25.910 --> 09:26.830
So this one.

09:27.110 --> 09:28.550
So this one the left one.

09:28.550 --> 09:32.950
So I'm going to drag it somewhere around here you can simply say.

09:33.830 --> 09:39.750
So we created this ground underscore or basically a parent game object in order to represent the first

09:39.750 --> 09:43.270
position or where from the ground just going to start.

09:43.270 --> 09:44.910
So that's why we created.

09:44.910 --> 09:51.150
So basically that is the thing and what we're going to do now we're going to move this up here I guess

09:51.150 --> 09:51.830
it's fine.

09:52.150 --> 09:54.790
And you you can see there are many tools.

09:54.790 --> 09:57.830
We have the brush tool and the shortcut key.

09:57.990 --> 09:58.470
Sorry.

09:58.870 --> 10:01.240
The shortcut key we can see is B.

10:01.400 --> 10:03.680
As you can see is B.

10:03.720 --> 10:08.760
So if you simply press down B on your keyboard it's going to move over to this brush tool.

10:09.040 --> 10:11.080
And we're going to move this up here.

10:12.320 --> 10:16.200
And this is that how you can do that.

10:16.200 --> 10:17.200
You can just place.

10:17.200 --> 10:22.800
And let's suppose you just place a a wrong tile anywhere anywhere over here.

10:22.920 --> 10:27.480
Then you can just remove that by selecting this eraser tool here D.

10:27.720 --> 10:28.800
So we're going to remove.

10:28.800 --> 10:30.800
So let's suppose I just place this one.

10:30.800 --> 10:32.080
So I just want to remove.

10:32.080 --> 10:37.960
So I can just click there in order to erase that or add the shortcut key is D.

10:38.000 --> 10:44.440
You can simply press down T on your keyboard in order to select that eraser tool in order to erase the

10:44.440 --> 10:46.840
tile, which you just want to erase.

10:47.080 --> 10:48.720
So I'm going to paste my tile.

10:48.720 --> 10:50.520
So let's paste this one.

10:50.520 --> 10:53.880
And this one should be here something like that.

10:54.440 --> 10:57.120
And this is pretty much fine.

10:57.480 --> 11:03.810
And let's suppose if you just want to move this tile, this whole tile, something like over here in

11:03.810 --> 11:08.410
the top position or in the bottom position or anywhere in the scene view.

11:08.450 --> 11:11.170
Then what you have to do, you need to select this tool.

11:11.170 --> 11:12.970
And the shortcut key is S.

11:12.970 --> 11:20.090
So select the that tool and then select the tiles that you just want to move anywhere in this view as

11:20.090 --> 11:20.410
in view.

11:20.410 --> 11:25.890
So in my case let's suppose I just want to move this a little bit down as something over here.

11:25.890 --> 11:29.130
So I'm going to select all of the tiles that I want to move.

11:29.130 --> 11:32.890
So select an area that you really want to move.

11:32.890 --> 11:36.050
And then after doing that make sure you select the next tool.

11:36.050 --> 11:39.890
And the shortcut key you can see is M or move selection.

11:39.890 --> 11:40.850
We can see.

11:40.850 --> 11:47.730
So we can select that tool in order to move this tile in the bottom or up or anywhere in the scene view.

11:47.730 --> 11:48.610
So we can move it.

11:48.610 --> 11:52.610
Something like this as you can see and this is cool thing.

11:53.170 --> 11:56.130
And now what we're going to do now we're going to place our tile.

11:56.130 --> 11:59.810
So let's place this and I'm going to move this one.

12:01.250 --> 12:07.890
And if you just want to make it copy instead of, uh, basically pasting, uh, one by one tiles, you

12:07.890 --> 12:14.210
can just simply copy these tiles and you can just paste it over here in order to make your work more,

12:14.250 --> 12:15.490
a lot more easy.

12:15.490 --> 12:19.570
And the tool you can select for that is a brush tool.

12:19.570 --> 12:21.730
And the shortcut key I guess not.

12:21.770 --> 12:23.890
It's make or mark selection tool.

12:23.930 --> 12:24.410
Sorry.

12:24.450 --> 12:29.450
And the shortcut key you can see I so you need to select that tool from the tile palette.

12:29.730 --> 12:35.410
Uh so make sure you just do that first and you can just select the area that you want to copy.

12:35.410 --> 12:38.130
So let's suppose I just want to copy this much.

12:38.130 --> 12:39.090
So I'm going to select.

12:39.250 --> 12:44.290
And now I can paste it anywhere uh like this as you can see.

12:44.290 --> 12:50.490
So let's suppose I just want to paste it over here I want to paste it over here.

12:50.490 --> 12:56.250
So make sure you created the parent game object and start pasting the tiles from that point.

12:56.250 --> 13:02.060
Because we're going to have the logic that how we can create, uh, just spawn multiple fronts because

13:02.060 --> 13:03.780
this is our endless runner game.

13:03.780 --> 13:06.100
So we need to spawn multiple grounds.

13:06.100 --> 13:11.860
So make sure after your first point or the A game object you just made it a parent.

13:11.860 --> 13:15.380
From that position you should start pasting your tile.

13:15.380 --> 13:21.300
So make sure you just do that and do uh, don't go outside of that area or this point.

13:21.300 --> 13:23.500
Something like if I just paste it over here.

13:23.500 --> 13:25.580
So it's going to be to the left side.

13:25.580 --> 13:29.940
So just don't do this because we're gonna spawn from this position.

13:29.940 --> 13:33.060
So that's why we created an empty game object first.

13:33.060 --> 13:35.500
From that position we just want to spawn.

13:35.500 --> 13:39.020
So that's why we're going to start pasting our tiles from that point.

13:39.020 --> 13:40.260
So you need to do that.

13:40.300 --> 13:41.700
Make sure you just do it.

13:42.380 --> 13:43.900
And this is the cool thing.

13:44.540 --> 13:49.820
And then next up we're gonna talk about all of these tools that how you can do it.

13:49.820 --> 13:57.180
I hope you get the idea that how you can just create your tile or how you can start your, uh, pasting

13:57.180 --> 14:00.340
your tiles in your game in order to make the ground.
