WEBVTT

00:00.080 --> 00:03.720
To replace this square with our enemy sprites.

00:03.720 --> 00:04.880
So I have it.

00:04.880 --> 00:11.680
So I'm gonna head over to my project app assets and then sprites folder, then anime folder, then E1

00:11.680 --> 00:12.360
folder.

00:12.400 --> 00:15.000
I have a lot of sprites, as you can see.

00:15.040 --> 00:17.360
Of course I will have in the resources.

00:17.360 --> 00:19.360
You can go and check that out.

00:19.400 --> 00:22.120
Basically you can download the resources.

00:22.120 --> 00:24.040
So I'm going to select this green one.

00:24.040 --> 00:25.800
So let's select that sprite sheet.

00:25.840 --> 00:27.040
Go over to Inspector.

00:27.040 --> 00:33.120
Click on Open Sprite Editor so we can see we have more than one sprite basically multiple.

00:33.280 --> 00:37.160
So that's why we're gonna choose sprite mode to multiple in the inspector.

00:37.160 --> 00:41.840
And let's choose a pixel per unit to something like 16 and filter mode.

00:41.880 --> 00:44.680
We're gonna choose Point of filter to get rid of blurry.

00:44.680 --> 00:48.360
And let's click on this apply button in the bottom by scrolling down.

00:48.840 --> 00:54.320
And instead of slicing automatically, we're gonna slice grid by cell count.

00:54.360 --> 01:00.470
To do so, let's click on this slice in the top left in our Sprite Editor tab, and let's select automatic

01:00.470 --> 01:01.870
to create by cell count.

01:01.870 --> 01:04.830
And let's count how many columns and rows we have.

01:04.830 --> 01:10.710
So 123456789

01:10.910 --> 01:12.150
1011.

01:12.150 --> 01:15.670
So 11 columns and five rows.

01:15.710 --> 01:16.670
I'm going to put.

01:16.870 --> 01:20.950
And after doing that let's click on slice then apply.

01:21.150 --> 01:23.350
And let's select the game view once again.

01:23.510 --> 01:29.390
And if we move over to that sprite and then click on this arrow we can see the individual sprite.

01:29.590 --> 01:36.910
So what we can simply do if we right click on this and then click on this properties in the in the bottom

01:36.910 --> 01:38.470
we can see the sprites.

01:38.830 --> 01:41.350
So let's choose the first sprite.

01:41.350 --> 01:43.590
And we will replace this square.

01:43.590 --> 01:47.270
So we can simply select our enemy GameObject in the hierarchy.

01:47.550 --> 01:51.590
Then go over to Inspector Sprite, Renderer component and sprite.

01:51.590 --> 01:54.870
As you can see it says square instead of square.

01:54.870 --> 01:56.230
We can select our.

01:56.270 --> 02:01.820
Let's select the first sprite of that, make sure you click on this arrow, then select the first one.

02:01.860 --> 02:04.340
Then drag it over to this sprite slot.

02:04.540 --> 02:08.780
And as soon as we drag it, we can see by now we have our enemy.

02:08.940 --> 02:15.940
But the problem is that it's facing to the right direction, and we want this enemy to face to the left

02:15.940 --> 02:21.900
direction in the direction is player is going, or basically player is facing.

02:21.900 --> 02:28.620
So what we can simply do, we can select our enemy in the hierarchy, then go over to Inspector Sprite

02:28.620 --> 02:29.860
renderer component.

02:29.980 --> 02:38.020
And we can see in our sprite renderer component flip in the x or Y basically horizontally as well as

02:38.060 --> 02:40.460
we can flip this enemy vertically.

02:40.460 --> 02:46.420
So we want this enemy to flip to the x axis or horizontally.

02:46.420 --> 02:48.300
So we're going to check this x box.

02:48.300 --> 02:53.140
And as soon as we check we can see it's now facing to the left direction.

02:53.140 --> 02:57.840
And we need to adjust the collider as the size of our enemy sprite.

02:57.840 --> 03:00.560
So let's click on this box Collider 2D.

03:00.600 --> 03:02.520
Let's click on this Edit Collider.

03:02.520 --> 03:07.680
Or you can simply click over here as well in the same view to edit the Collider.

03:07.680 --> 03:11.600
And let's edit the collider as the size of our enemy.

03:11.880 --> 03:13.560
Something like this much?

03:15.560 --> 03:16.960
Let's make it.

03:17.000 --> 03:22.080
Now this seems pretty much fine, and we can select our enemy and select this move tool.

03:22.080 --> 03:30.320
In the scene view, we can just move a little bit up and let's add our rigidbody 2D for gravity.

03:30.320 --> 03:35.960
So let's click on this add component and let's search for rigidbody 2D.

03:36.120 --> 03:37.640
And let's attach that.

03:37.840 --> 03:39.400
And what we will do.

03:39.440 --> 03:42.920
We're gonna increase the gravity scale a little bit up.

03:43.120 --> 03:48.600
So let's make gravity scale to three and collision detection to continuous.

03:48.600 --> 03:52.960
And we will choose interpolate to interpolate to making a little bit smooth.

03:53.120 --> 03:56.470
And we're gonna freeze the rotation about z axis.

03:56.670 --> 03:57.830
And now it's done.

03:57.830 --> 04:03.990
And you can increase the mass as well if you want to make your anime a little bit heavy.

04:03.990 --> 04:10.270
So I'm gonna make the mask something around five and we can create the animation by now.

04:10.270 --> 04:11.590
So let's do that.

04:11.590 --> 04:15.350
But before we do, let's select the sprite sheet from that folder.

04:15.350 --> 04:19.550
Then right click on it and then click on this properties in the bottom.

04:19.550 --> 04:21.390
And we can see these tabs.

04:21.430 --> 04:25.270
Just open it up and we can just scale this up a little bit.

04:25.310 --> 04:27.110
This from the bottom.

04:27.110 --> 04:34.270
And we can notice that first five sprite of this anime is idle 12345.

04:34.310 --> 04:40.710
As you can see, if you're not doing then you can just select that sprite sheet, go over to Inspector,

04:40.710 --> 04:46.150
click on Open Sprite Editor and we can just take a look right over here as well.

04:46.390 --> 04:49.430
We can see 1234, five.

04:49.470 --> 04:51.870
Sprites is the ideal of this anime.

04:52.110 --> 04:56.620
So we can just make the animation by now or what you can do.

04:56.660 --> 04:59.220
I'm going to select my game view right over here.

04:59.220 --> 05:01.300
We can simply select that Spritesheet.

05:01.300 --> 05:04.500
We can right click on it and then click on this properties.

05:04.500 --> 05:07.100
And we can see the now new tab.

05:07.100 --> 05:08.100
Just open it up.

05:08.100 --> 05:09.820
And this is pretty much fine.

05:10.060 --> 05:14.340
So we can see first five five sprite of this anime is idle.

05:14.340 --> 05:20.660
So when I click on that sprite sheet to see the individual sprite and we're gonna select first five

05:20.780 --> 05:25.900
five sprite 12345 by holding down shift.

05:25.900 --> 05:30.660
And then what you have to do, you just drag it over to anime GameObject in the hierarchy.

05:30.700 --> 05:37.340
Top of this anime GameObject in the hierarchy to make the animation right away as we have done player

05:37.380 --> 05:38.140
a GameObject.

05:38.140 --> 05:40.140
Basically we doing the same thing.

05:40.300 --> 05:42.260
So in the top left we can see assets.

05:42.260 --> 05:48.540
So let's click there and in assets we can see we already created a animations folder.

05:48.540 --> 05:50.020
So let's open that up.

05:50.220 --> 05:53.530
And let's create another sub folder for this These enemies.

05:53.530 --> 05:57.730
So let's right click then new a new folder.

05:57.890 --> 06:05.330
And I'm going to call this folder to something like enemy underscore animation animations.

06:05.490 --> 06:06.930
And let's hit enter.

06:06.970 --> 06:10.730
Let's open up that subfolder as well by double clicking on it.

06:10.730 --> 06:14.890
So since this just gonna, just gonna be our first enemy.

06:14.970 --> 06:22.290
So let's create another subfolder inside this enemy underscore animations folder for this first enemy.

06:22.410 --> 06:25.610
So let's right click then new folder.

06:25.610 --> 06:32.850
And let's call this folder to something like enemy one underscore animation animation.

06:33.050 --> 06:37.770
And let's open this up folder as well by double clicking on it.

06:37.970 --> 06:40.170
And we have to name the animation.

06:40.170 --> 06:42.130
So this will be first enemy.

06:42.130 --> 06:44.490
And the animation is idle.

06:44.490 --> 06:50.730
So we're gonna call this one enemy one enemy one underscore idle.

06:51.050 --> 06:54.200
And then after doing that, let's click on this save button.

06:54.680 --> 06:57.400
Uh, now it's gonna make the animation right away.

06:57.400 --> 07:00.200
So if we select I'm gonna cut this step for now.

07:00.200 --> 07:02.920
Or we can simply drag it right over here.

07:02.920 --> 07:08.400
You can toggle it anywhere you want and less simply clicking over here.

07:08.400 --> 07:14.560
Or you can simply just move it by holding down, basically clicking your mouse button.

07:14.560 --> 07:16.960
And you can move it anywhere you like.

07:17.280 --> 07:22.560
Or you can simply cut this for now, and let's select the enemy GameObject in the hierarchy.

07:22.560 --> 07:28.600
And if we move over to animation tab and then click on this play button, we can see it's now playing

07:28.600 --> 07:30.440
the Idle Animation clip.

07:30.440 --> 07:34.280
So we're gonna have the arrow shooting animation clip.

07:34.280 --> 07:35.640
So let's create those.

07:35.920 --> 07:37.840
So let's head over to project tab.

07:38.040 --> 07:45.480
And before we create we need to make sure uh, that uh how many sprites we have for our enemy.

07:45.800 --> 07:49.800
Uh, fire up uh, arrow fire up animations.

07:49.800 --> 07:51.470
So let's right click on this.

07:51.470 --> 07:53.150
Let's click on this properties.

07:53.430 --> 07:54.630
And we can see

07:54.830 --> 08:00.950
1123456789

08:00.950 --> 08:02.230
1011.

08:02.230 --> 08:04.430
So 11 from here.

08:04.430 --> 08:06.870
So this first five sprites.

08:08.270 --> 08:12.390
Really sorry this first sprites is idle.

08:12.390 --> 08:14.030
So we're going to select from here.

08:14.030 --> 08:18.990
And let's count it 11 sprites we have for showing out our array.

08:19.030 --> 08:19.950
So one.

08:19.950 --> 08:26.230
So this is the first 123456789

08:26.550 --> 08:27.790
1011.

08:27.790 --> 08:30.990
So we're going to select from 11 by holding down shift.

08:31.150 --> 08:34.750
And let's drag it over to this anime GameObject in the hierarchy.

08:34.790 --> 08:37.110
Top of this anime GameObject in the hierarchy.

08:37.390 --> 08:44.550
So let's go to Assets animation folder, any anime animations folder, anime one animation folder,

08:44.750 --> 08:51.970
and we're going to call this one anime one arrow shooting fire arrow or let's call a arrow fire.

08:52.090 --> 08:56.650
Let's call arrow fire and let's click on hit enter.

08:56.650 --> 08:59.890
Or you can simply click on that save button as well.

08:59.890 --> 09:03.570
And let's suppose you just want to zoom a little bit.

09:03.610 --> 09:11.690
Then in the bottom right we can see in our project tab we can just scale this up in order to see perfectly.

09:11.690 --> 09:13.330
But I'm gonna leave with this.

09:13.570 --> 09:17.130
And if we select our enemy go over to animation tab.

09:17.130 --> 09:20.170
Then click here and then choose this enemy one.

09:20.170 --> 09:23.890
Underscore an arrow fire and then click on this play button.

09:23.890 --> 09:27.490
We can see it's shooting out the array as arrow.

09:27.730 --> 09:34.330
And also we're going to create some other animation clip which is this anime heart and the anime date.

09:34.370 --> 09:35.610
So let's do that.

09:35.610 --> 09:38.250
So let's head over to project tab one more time.

09:38.250 --> 09:40.330
Let's select this sprite editor.

09:40.330 --> 09:42.690
Let's right sorry this sprite sheet.

09:42.730 --> 09:44.850
Let's right click on it properties.

09:45.370 --> 09:49.160
And let's see Hurting.

09:49.160 --> 09:51.760
We have one, two, three, four, five.

09:52.400 --> 09:54.480
So five sprites we have hurting.

09:54.840 --> 10:01.160
So from here I guess basically let's scale in the bottom right.

10:01.160 --> 10:01.920
We can see.

10:01.920 --> 10:09.320
So let's scale for it now so we can see 12345.

10:10.320 --> 10:13.280
Sorry I guess one two.

10:16.960 --> 10:19.080
So this 123.

10:19.960 --> 10:26.120
So this I guess this uh 12345.

10:26.120 --> 10:27.480
So this five sprite.

10:27.480 --> 10:30.160
So we're going to select all of them by holding down shift.

10:30.200 --> 10:33.920
Let's drag it over to top of this anime GameObject in the hierarchy.

10:34.160 --> 10:40.120
Let's go to assets in the top left then animations anime, animation, anime one animation.

10:40.320 --> 10:43.320
And this will be anime one underscore heart.

10:43.320 --> 10:50.190
So let's call this animation clip to anime one underscore heart and let's hit Enter or save.

10:50.590 --> 10:55.750
And now if we choose that animation clip then play this button.

10:55.750 --> 11:00.590
We can see it's playing the hurting animation clip over again and again.

11:00.830 --> 11:02.950
And now let's create the death one.

11:02.950 --> 11:05.550
So let's go over to project tab one more time.

11:05.990 --> 11:09.110
And we have the date one over here.

11:09.790 --> 11:11.110
So from here.

11:11.630 --> 11:15.790
So we will select all of them by holding down shift.

11:16.030 --> 11:19.230
And let's drag it over to this enemy game object.

11:19.430 --> 11:21.750
Top of this enemy game object in the hierarchy.

11:22.070 --> 11:27.430
And let's go to assets enemy animation enemy animations enemy one animation.

11:27.590 --> 11:29.790
And this will be our death one.

11:29.790 --> 11:33.590
So we can call simply enemy one underscore death.

11:33.590 --> 11:35.630
So let's call this death.

11:35.910 --> 11:39.070
And let's click on this save button or hit enter.

11:39.470 --> 11:41.670
And let's move to animation tab.

11:41.670 --> 11:48.180
And if we choose the death one we can see it's playing the death animation clip over again and again.

11:48.180 --> 11:51.820
So we created all of the animation and we can take a look.

11:51.820 --> 11:55.900
If we select our anime in the hierarchy, move over to animator tab.

11:55.900 --> 11:58.220
We can see all of the animation we have.

11:58.420 --> 12:07.220
We we created anime one underscore idle anime one underscore fire, anime heart, and anime death.

12:07.300 --> 12:09.780
So we have all of this animation clip.

12:10.140 --> 12:17.940
And if we move over to animation tab and we can we can see, uh, so some animation clip, I don't want

12:18.020 --> 12:23.740
uh, to be loop the, uh, basically the heart one, heart one as well as the dead one.

12:23.740 --> 12:28.420
I don't want this to animation to loop over again and again.

12:28.420 --> 12:30.340
So we're gonna uncheck the loop time.

12:30.340 --> 12:34.380
So as we have done inside this player animations clip.

12:34.380 --> 12:39.860
So we will we will head over to project tab then assets folder then animation folder.

12:39.860 --> 12:44.260
Basically we need to move over to that folder in which folder we place it.

12:44.260 --> 12:46.930
All of the animation of this anime.

12:47.930 --> 12:55.130
So we place it inside this anime animation folder, then anime one animation folder.

12:55.410 --> 12:57.690
And we can see all of the animation clip.

12:57.690 --> 13:03.610
We have the arrow fire, we have the arrow death and hurt as well as the idol.

13:03.890 --> 13:07.610
So what we will do, we will choose the hard one and the death one.

13:08.050 --> 13:13.210
By holding down control, we can choose or you can simply hold down shift as well.

13:13.370 --> 13:16.050
But let's suppose you choose one to choose custom.

13:16.050 --> 13:22.090
Then hold down Ctrl on your keyboard and select the and just click the mouse arrow.

13:22.330 --> 13:24.970
So we will choose the date and the hard one.

13:25.010 --> 13:28.010
Let's go over to Inspector and we can see Loop time.

13:28.010 --> 13:29.570
So we're going to uncheck that.

13:29.570 --> 13:35.490
Now these two animation clip not gonna be looped but the idol and the arrow fire will be loop.

13:35.690 --> 13:38.090
And I'm going to scale it down a little bit.

13:38.090 --> 13:45.630
So in the project tab in the bottom right you can see this scaler tool in order to zoom in or as zoom

13:45.630 --> 13:46.990
in or zoom out.

13:46.990 --> 13:48.430
So you can just do that.

13:48.870 --> 13:51.790
So I hope you get the idea that how you can do it.

13:51.790 --> 13:54.710
And let's make this anime as well a prefab.

13:54.710 --> 13:57.470
So we are gonna have the copy of it.

13:57.470 --> 14:04.630
So let's go over to assets then prefabs folder, let's select our anime in the hierarchy and then drag

14:04.630 --> 14:08.710
it over to this prefabs folder in order to turn it into a prefab.

14:09.110 --> 14:10.550
And now this is fine.

14:10.550 --> 14:16.510
And we can simply press down Ctrl s on our keyboard in order to save our project.

14:16.550 --> 14:23.750
Basically, we have done the same same thing as we have done with our player animation player animation.

14:23.750 --> 14:27.350
So we created all of the animation clip of this anime.

14:27.830 --> 14:29.510
So I hope you get the idea.

14:29.670 --> 14:35.990
And you can create multiple enemies in this same way as we created this anime one.

14:35.990 --> 14:39.990
So let's call this one enemy one instead of calling enemy.

14:40.110 --> 14:41.790
So this will be the first enemy.

14:41.790 --> 14:42.780
So that's why.

14:42.820 --> 14:49.340
So what we can do, we can simply open up the prefab so we can head over to our project app assets and

14:49.340 --> 14:50.700
then prefabs folder.

14:50.700 --> 14:54.300
And let's double click on this enemy in order to open that up.

14:54.500 --> 14:56.380
And let's go over to Inspector.

14:56.380 --> 14:59.380
And let's call this one to something like enemy one.

14:59.700 --> 15:01.780
And after doing it let's go back.

15:01.780 --> 15:03.940
So let's click on this rename file.

15:04.500 --> 15:14.460
And if we go back still the change is not been not happened inside this enemy GameObject in the hierarchy.

15:14.700 --> 15:16.540
So we can just manually do it.

15:16.540 --> 15:19.100
So let's select our enemy in the hierarchy.

15:19.300 --> 15:22.540
Go over to Inspector and let's call this enemy one.

15:22.780 --> 15:26.420
And we can just move over to overrides and then apply all.

15:26.420 --> 15:32.660
If we change something around inside this enemy one game object, it's going to be saved into this enemy

15:32.700 --> 15:36.420
game enemy one GameObject prefab as well.

15:36.460 --> 15:41.900
And now I'm gonna press down Ctrl S on my keyboard in order to save my project.
