WEBVTT

00:00.160 --> 00:03.760
We will replace this square with our enemy sprite.

00:03.760 --> 00:05.400
So let's do that for.

00:05.640 --> 00:10.360
In order to do that, let's go to project tab assets and then sprites folder.

00:10.360 --> 00:15.000
I have enemy sprites over here in my enemies folder.

00:15.040 --> 00:17.720
Of course I will have a link in the resources.

00:17.720 --> 00:19.760
You can go and check that out.

00:19.960 --> 00:22.640
So I'm going to select the enemy.

00:23.040 --> 00:27.240
And I can see I have it over here in one folder.

00:27.440 --> 00:28.600
So if I select.

00:29.600 --> 00:35.920
So this is not the one I guess e2 okay so e2 in this E2 folder.

00:35.920 --> 00:37.800
So I'm going to select my idle sprite.

00:37.800 --> 00:40.280
So I have a idle sprite over here.

00:40.280 --> 00:41.440
So let's select that.

00:41.440 --> 00:42.480
Go over to Inspector.

00:42.480 --> 00:47.400
Click on this Open Sprite editor and we can see our sprite.

00:47.840 --> 00:50.320
And we have multiple sprites.

00:50.320 --> 00:52.440
So we need to split individually.

00:52.440 --> 00:58.680
So sprite mode to choose multiple in the inspector and make this pixel per unit 16 something like that.

00:58.680 --> 01:00.370
And to get rid of blood.

01:00.370 --> 01:04.170
If we're going to choose point no, filter a filter mode to point no filter.

01:04.170 --> 01:09.250
And after doing all of these things, click on this apply button in the bottom and we're going to slice

01:09.250 --> 01:10.370
in individually.

01:10.370 --> 01:12.410
So let's go to Sprite Editor tab.

01:12.410 --> 01:14.090
So let's click on this slice.

01:14.090 --> 01:19.010
Then select automatic to create by cell count and count how many columns and rows it has.

01:19.010 --> 01:22.930
It has 369 ten columns.

01:22.930 --> 01:25.770
So we're going to put ten columns and one row.

01:25.890 --> 01:27.890
And after doing that click on slice.

01:27.890 --> 01:35.210
And then click on this apply button in the top right in Sprite Editor tab I guess we have uh ten or

01:35.250 --> 01:36.810
we put uh ten.

01:36.810 --> 01:45.890
So let's count one more time the columns, which is 36789 ten, 11, 12, 13.

01:45.890 --> 01:47.570
So we have 13 columns.

01:47.570 --> 01:48.090
Sorry.

01:48.130 --> 01:52.650
We just put it, uh, 13 I guess 13 or 12.

01:52.650 --> 01:54.370
So let's select 12.

01:54.410 --> 01:58.420
Then click on slice and then click on apply button in the top right?

01:58.420 --> 02:02.380
So I guess we don't have to help, so we need to cut one more time.

02:02.380 --> 02:04.300
I'm really apologize for that.

02:04.300 --> 02:11.420
33456789

02:11.460 --> 02:12.740
1011.

02:12.740 --> 02:15.620
So we have 11 I'm really apologize for that.

02:15.660 --> 02:16.140
11.

02:16.140 --> 02:17.460
And then click on slice.

02:17.460 --> 02:19.180
Then click on apply.

02:19.300 --> 02:21.300
And let's select the game view one more time.

02:21.300 --> 02:22.860
And let's go to that spreadsheet.

02:22.860 --> 02:26.540
And then click on this arrow in order to see the individual.

02:26.540 --> 02:32.140
So what we're going to do now we're going to select our square game object or this rectangle rectangular

02:32.140 --> 02:32.740
square.

02:32.860 --> 02:37.340
So let's select that and we're going to move over to Spriterenderer component.

02:37.340 --> 02:39.380
And we need to replace this sprite.

02:39.420 --> 02:40.780
As you can see sprite.

02:40.780 --> 02:42.100
And it says square.

02:42.100 --> 02:43.620
So we're going to replace this one.

02:43.620 --> 02:48.020
So let's select the first sprite or any of them and drag it over to this slot.

02:48.140 --> 02:51.780
And as soon as we drag it now we are able to see.

02:51.780 --> 02:56.350
But the problem is that it's kind of a same stretch in the y axis.

02:56.350 --> 02:58.830
So we will go to transform then scale.

02:58.830 --> 03:00.670
And in the y we're going to put one.

03:01.110 --> 03:05.950
And we can see that this sprite just looking to the left right direction.

03:06.190 --> 03:10.590
And we just want to flip this anime game object to the left direction to do that.

03:10.630 --> 03:15.790
To do that, we can simply move over to Sprite Renderer and we're going to flip the x axis.

03:15.790 --> 03:22.070
Or you can simply say horizontally, and we're going to drag this anime game object a little bit up.

03:22.070 --> 03:27.230
So let's select the move tool from our scene view, and let's move it up in the y axis.

03:27.230 --> 03:30.910
And we need to resize our box Collider 2D as well.

03:30.950 --> 03:34.150
To do to do that let's go to Box Collider 2D.

03:34.150 --> 03:36.230
And let's click on this Edit Collider.

03:36.230 --> 03:41.110
And we're going to edit the Collider as the size of our anime game object.

03:42.190 --> 03:50.550
Sorry, we need to edit our collider and I guess we cannot edit.

03:50.550 --> 03:52.390
So we need to drag it up.

03:52.510 --> 03:57.080
Or we can simply move over to this offset and size and we can just make this.

03:57.440 --> 04:00.120
And this one seems pretty much fine.

04:00.120 --> 04:04.920
And I'm going to drag it over here and let's drag it here.

04:05.480 --> 04:08.040
And we're going to make the opposite sorry offset.

04:08.040 --> 04:09.840
We're going to set to zero.

04:10.080 --> 04:13.000
And the x I'm going to make it something like this much.

04:13.040 --> 04:15.000
Just play around with these values.

04:15.000 --> 04:16.040
And then we're going to get.

04:16.040 --> 04:18.080
So I'm going to do 1.2.

04:18.760 --> 04:21.800
And this 1.2 seems pretty much good number.

04:21.800 --> 04:22.880
And this is fine.

04:23.600 --> 04:27.720
And we're going to make this anime game object a prefab as well.

04:27.720 --> 04:30.200
So let's select the anime GameObject in the hierarchy.

04:30.200 --> 04:35.680
And we're going to drag it over to this uh prefabs folder in order to make it prefab.

04:36.200 --> 04:38.440
And we're going to make the animation.

04:38.560 --> 04:43.720
Uh, basically we need to make our animation, which will be the ideal one as well as we're going to

04:43.720 --> 04:45.440
have the run animation.

04:45.440 --> 04:50.440
Sorry, we're going to have the fire animation of this anime game object as well.

04:50.440 --> 04:55.420
But before we do, let's, uh, uh, let's split those sprite individually.

04:55.420 --> 04:58.940
So I'm gonna move over to that folder and let's select the attack one.

04:59.460 --> 05:00.820
Uh, attack one or attack two.

05:00.860 --> 05:02.500
So I'm going to select my attack one.

05:02.500 --> 05:04.020
Let's go to Inspector.

05:04.020 --> 05:07.260
Click on Sprite Editor and we're going to slice individual.

05:07.260 --> 05:12.060
So we're going to choose pixel per unit to 16 and filter mode to point filter.

05:12.060 --> 05:13.340
Let's click on this apply.

05:13.380 --> 05:15.260
Let's go to a Sprite Editor tab.

05:15.380 --> 05:17.820
And we're gonna slice individually.

05:18.020 --> 05:19.620
So I'm going to click on this slice.

05:19.620 --> 05:21.860
And we're going to select Read by cell count.

05:21.860 --> 05:24.460
And count how many columns and rows it has.

05:24.460 --> 05:26.540
So it has three columns and one row.

05:26.740 --> 05:30.180
And also we're gonna have the shooting animation clip.

05:30.180 --> 05:31.980
So we have it over here.

05:31.980 --> 05:33.540
So let's select that spreadsheet.

05:33.580 --> 05:34.820
Go over to Inspector.

05:34.860 --> 05:38.220
Let's just split this one individually as well.

05:38.540 --> 05:44.020
So we're going to make pixel per unit to 16 filter mode to point filter click on apply.

05:44.460 --> 05:46.380
And let's slice individually.

05:46.380 --> 05:47.980
And we're going to slice it for.

05:48.020 --> 05:50.500
Let's click on this slice and then apply.

05:51.030 --> 05:53.990
and we are ready to make those animation by now.

05:53.990 --> 05:56.670
So let's select the game view once again over here.

05:56.670 --> 05:58.750
And we're going to make it in a fast way.

05:58.910 --> 05:59.950
The animation.

05:59.950 --> 06:05.350
And in order to make the animation in a fast way, basically what you have to do, you need to select

06:05.350 --> 06:10.430
the individual sprite and you need to drag it on top of this anime GameObject in the hierarchy.

06:10.430 --> 06:12.710
So we're going to make the idle animation first.

06:12.710 --> 06:17.630
So let's select the idle sprite and then click over here to see the individual sprite.

06:17.790 --> 06:19.750
And we're going to select all of this sprite.

06:19.750 --> 06:23.150
But before we do let's create an animation folder.

06:23.150 --> 06:28.270
Basically we're going to create a anime animation folder and anime animation subfolder.

06:28.270 --> 06:33.630
You can simply say we're going to create that, and we're going to place all of the anime animation

06:33.630 --> 06:36.830
into that folder to keep our project clean.

06:36.830 --> 06:40.270
So let's go to Project App Assets and then animation folder.

06:40.270 --> 06:44.230
And let's create a subfolder by right click create and then folder.

06:44.230 --> 06:47.670
And we're going to name this folder to something like Anime animation.

06:47.670 --> 06:50.640
So we're going to call it anime underscore animation.

06:50.880 --> 06:57.440
And we're going to place all of the anime animation into this anime and underscore animation folder.

06:57.440 --> 06:59.840
And let's also create a sub animation.

06:59.840 --> 07:05.480
And we're going to call that animation to anime one animation because we're going to have multiple enemies.

07:05.480 --> 07:08.480
So we're gonna have multiple enemies animation.

07:08.480 --> 07:13.360
So that's why we're going to create another sub folder for our this anime.

07:13.360 --> 07:16.320
So let's right click on this anime underscore animation.

07:16.320 --> 07:17.640
Let's create folder.

07:17.640 --> 07:21.720
And we're going to name this folder to something like anime one animation.

07:21.720 --> 07:26.520
So anime anime one underscore animation folder.

07:26.760 --> 07:30.160
And let's hit enter in order to create that.

07:30.160 --> 07:35.680
Now let's move over to that spreadsheet and we're going to select all of the individual sprite by holding

07:35.680 --> 07:36.520
down shift.

07:36.520 --> 07:40.000
And then drag it over to this anime GameObject in the hierarchy.

07:40.000 --> 07:42.320
And it's going to make the animation right away.

07:42.520 --> 07:46.320
So we need to choose a folder where we want to place our animation.

07:46.320 --> 07:51.050
We do know we created the anime animation folder in our assets folder.

07:51.050 --> 07:54.610
So let's move over to assets and we can see animation folder.

07:54.610 --> 07:56.090
So let's open that up.

07:56.090 --> 07:59.290
And we're going to open up this anime animation folder.

07:59.290 --> 08:05.170
And then this anime one and underscore animation because this will be the first animation.

08:05.170 --> 08:10.090
So that's why and we can call this anime game object to something like anime one as well.

08:10.090 --> 08:11.850
It's basically totally up to you.

08:12.010 --> 08:14.770
So we have to name the animation what we want to name it.

08:14.770 --> 08:19.610
So I'm going to call anime one underscore idle animation.

08:19.610 --> 08:21.210
And let's click on this save.

08:21.250 --> 08:26.450
And now if we select our anime then go over to animation tab and then click on this play button.

08:26.450 --> 08:31.370
We can see animation is playing over again and again which is the ideal one.

08:31.370 --> 08:38.170
So we need to create another animation which will other animation as well, which is the animation clip

08:38.170 --> 08:44.570
of this anime game object as well as we're going to create the heart a animation of this anime game

08:44.610 --> 08:45.050
object.

08:45.050 --> 08:50.260
But before we do, I'm going to name this enemy to something like enemy one game object.

08:50.260 --> 08:52.060
So I'm going to name it to enemy one.

08:52.100 --> 08:55.140
Let's go to overrides and then click on this Apply All.

08:56.540 --> 09:01.860
And in order to change in Enemy game Object prefab as well.

09:01.860 --> 09:06.180
So we're going to make the other animation which will be the fire or the shooting one.

09:06.180 --> 09:09.380
So let's go to project tab E to animation.

09:09.380 --> 09:12.300
And let's select the shoot a sprite sheet.

09:12.300 --> 09:13.660
And let's click over here.

09:13.660 --> 09:18.620
And we're going to select all of the animation by holding down basically individual sprite by holding

09:18.620 --> 09:19.180
down shift.

09:19.180 --> 09:22.740
And then drag it over to this enemy GameObject in the hierarchy.

09:23.060 --> 09:28.980
And sorry, we just forgot to just name it to something like enemy one, so I'm going to call it enemy

09:29.020 --> 09:31.780
one and this is fine now.

09:32.380 --> 09:36.700
So sorry we we not able to name it.

09:36.740 --> 09:39.260
Sorry I'm really apologize for that.

09:39.820 --> 09:41.060
And now it's fine.

09:41.380 --> 09:47.110
So now let's select all of the sprite sheet of all of the individuals part of this shooting animation,

09:47.110 --> 09:52.030
and we're going to drag it over top of this anime, one GameObject in the hierarchy in order to make

09:52.030 --> 09:53.510
the animation right away.

09:53.510 --> 09:56.870
So let's go to assets anime, animation, anime, animation.

09:56.870 --> 10:02.830
Then this and we're going to name this animation clip to something like anime one underscore sorting.

10:02.830 --> 10:05.870
Because this is just going to be the sorting animation clip.

10:05.870 --> 10:10.630
So I'm going to call it anime underscore shooting sorting.

10:10.670 --> 10:14.190
And let's click on this save in order to create the animation right away.

10:14.910 --> 10:17.470
And we also need to create the heart animation.

10:17.470 --> 10:24.470
But before we do, let's have a look on the animation or the shooting animation of this anime game object.

10:24.470 --> 10:27.190
So let's select the anime one GameObject in the hierarchy.

10:27.230 --> 10:35.270
Let's go to animation tab and then click over here in order to choose that and we're not able to see

10:35.710 --> 10:37.270
let's click on this play button.

10:37.910 --> 10:39.230
And this is fine now.

10:40.030 --> 10:44.640
And we uh we don't have the enemy under enemy one.

10:44.680 --> 10:46.560
Underscore the idle animation clip.

10:46.560 --> 10:48.000
We're going to create that one.

10:48.040 --> 10:49.680
So we're going to select all of them.

10:50.040 --> 10:51.280
Let's drag it over here.

10:52.400 --> 10:53.000
Assets.

10:53.040 --> 10:53.840
Animation.

10:53.840 --> 10:54.640
Enemy one.

10:54.640 --> 10:55.160
Enemy.

10:55.360 --> 10:57.160
And this will be the idle one.

10:58.440 --> 11:00.240
So let's have a look.

11:00.600 --> 11:02.560
And now this is predefined.

11:03.840 --> 11:06.360
And we need to adjust the collider as well.

11:06.440 --> 11:08.480
So if I just click on this play button.

11:08.480 --> 11:10.200
But we can just ignore that.

11:10.240 --> 11:12.800
So let's create the heart animation by now.

11:12.920 --> 11:16.040
So let's select the hardest sprite from here.

11:16.520 --> 11:23.880
So over here we have let's click on Open sprite editor pixel per unit 16 point of filter.

11:24.360 --> 11:26.280
And we're going to select individually.

11:26.280 --> 11:28.000
So how many three five.

11:28.040 --> 11:32.680
So we're going to put five columns and one row slice and apply.

11:33.120 --> 11:35.960
And let's let's select that sprite sheet.

11:35.960 --> 11:37.480
And let's click on this arrow.

11:37.480 --> 11:43.210
And we're going to select all of the individual sprite of heart animation sprites, and let's drag it

11:43.210 --> 11:47.010
over to this anime game object enemy one GameObject in the hierarchy.

11:47.250 --> 11:54.810
Let's go to assets and over here and this is gonna we're gonna call this animation clip two enemy one

11:54.850 --> 11:57.890
underscore heart or heart animation simply.

11:58.250 --> 11:59.770
And let's click on save.

12:00.170 --> 12:03.290
And now we can play this one as well.

12:03.290 --> 12:04.410
So let's click on this.

12:04.410 --> 12:09.290
As you can see Heart Animation Clip is just playing over again and again.

12:09.290 --> 12:13.810
And we can click on this play button in order to see the animation as well.

12:13.810 --> 12:17.930
When the game starts, I'm gonna make my player speed a little bit slow.

12:18.050 --> 12:22.570
So let's click on this play button so we can just able to see that.

12:24.530 --> 12:27.370
And I'm going to make my player speed a little bit slow.

12:27.370 --> 12:29.410
So I'm going to select my player game object.

12:29.690 --> 12:34.210
And in player skip I'm going to make the speed something like it's already slow.

12:34.250 --> 12:37.090
We don't wanna make it more slow.

12:37.090 --> 12:39.630
So let's click on this play button instead.

12:48.270 --> 12:50.430
So let's have a look on this.

12:51.470 --> 12:56.990
And now, as soon as the game started, the fire animation is just playing over again and again.

12:57.310 --> 13:04.190
So we need to do instead of playing the fire animation clip, we need to play the idle animation clip

13:04.190 --> 13:05.910
of this anime game object.

13:05.910 --> 13:07.390
So let's get out of play mode.

13:07.430 --> 13:13.470
But before we do, let's create, uh, basically let's add up rigidbody 2D to this anime game object

13:13.470 --> 13:13.990
as well.

13:13.990 --> 13:17.550
So we're going to have the uh, you can say, uh, gravity.

13:17.550 --> 13:20.710
So let's click on this add component in the inspector.

13:20.710 --> 13:23.510
And we're going to attach a rigid body 2D.

13:23.710 --> 13:29.070
And we're going to make the gravity scale to something like three and collision detection to continuous.

13:29.070 --> 13:32.030
And we're going to freeze the rotation about z axis.

13:32.030 --> 13:33.630
If we just don't do it.

13:33.630 --> 13:39.840
And then go to transform then rotation and play around with z axis As you can see, it's gonna rotate

13:39.840 --> 13:40.520
like this.

13:40.520 --> 13:41.440
So stop.

13:41.480 --> 13:46.360
To stop doing this, we need to freeze the rotation about z axis.

13:46.360 --> 13:50.120
So I'm going to set again to zero in z rotation.

13:50.320 --> 13:56.080
And make sure you just go to uh basically click on this rigid body and then freeze the rotation about

13:56.120 --> 13:56.920
z axis.

13:56.920 --> 14:01.600
And also make sure you just, uh, choose this collision detection to continuous.

14:01.600 --> 14:06.360
And I'm going to choose interpolate to interpolate to basically make it a little bit smooth.

14:06.360 --> 14:08.600
Or you can just ignore as well.

14:08.600 --> 14:11.080
Let's go to overrides and then apply all.

14:11.440 --> 14:17.360
And now what we need to do, we need to make the idle animation clip is the default one.

14:17.360 --> 14:23.480
So if I select my anime one game object and then move over to animator tab, we can see we have three

14:23.480 --> 14:24.520
animation clip.

14:24.560 --> 14:27.000
We have shooting one idle and the heart.

14:27.000 --> 14:31.240
So we do want this idle animation clip to be the default one.

14:31.240 --> 14:34.960
So we're gonna right click on this anime one underscore idle.

14:35.000 --> 14:38.450
And we're going to click on this set as layer default state.

14:38.490 --> 14:43.930
Now if I just click on this play button in the top, you will see this animation clip just going to

14:43.930 --> 14:45.690
play right after the game start.

14:45.690 --> 14:49.690
Because we just made this animation clip is the default one.

14:49.690 --> 14:52.890
So that's why it's going to play right after the game starts.

14:52.930 --> 14:59.570
As soon as the game starts, we can see enemy one is now playing the idle animation clip over again

14:59.570 --> 15:06.170
and again, and we can take a look in this animator tab as well by scrolling our mouse to zoom in or

15:06.210 --> 15:07.050
zoom out.

15:07.050 --> 15:11.970
So we also need to make transition from this idle to shooting as well as the heart.

15:12.530 --> 15:14.050
So let's get out of play mode.

15:14.090 --> 15:21.130
I hope you get the idea that how you can make the animation in a fast way, and if you just add in trouble

15:21.170 --> 15:28.010
to finding this animation and then animator tab, then you basically need to go to window in the top.

15:28.010 --> 15:30.410
Then you can see over here animation.

15:30.410 --> 15:34.490
And the shortcut key is control six as well as the animator tab.
