We will replace this square with our enemy sprite.
So let's do that for.
In order to do that, let's go to project tab assets and then sprites folder.
I have enemy sprites over here in my enemies folder.
Of course I will have a link in the resources.
You can go and check that out.
So I'm going to select the enemy.
And I can see I have it over here in one folder.
So if I select.
So this is not the one I guess e2 okay so e2 in this E2 folder.
So I'm going to select my idle sprite.
So I have a idle sprite over here.
So let's select that.
Go over to Inspector.
Click on this Open Sprite editor and we can see our sprite.
And we have multiple sprites.
So we need to split individually.
So sprite mode to choose multiple in the inspector and make this pixel per unit 16 something like that.
And to get rid of blood.
If we're going to choose point no, filter a filter mode to point no filter.
And after doing all of these things, click on this apply button in the bottom and we're going to slice
in individually.
So let's go to Sprite Editor tab.
So let's click on this slice.
Then select automatic to create by cell count and count how many columns and rows it has.
It has 369 ten columns.
So we're going to put ten columns and one row.
And after doing that click on slice.
And then click on this apply button in the top right in Sprite Editor tab I guess we have uh ten or
we put uh ten.
So let's count one more time the columns, which is 36789 ten, 11, 12, 13.
So we have 13 columns.
Sorry.
We just put it, uh, 13 I guess 13 or 12.
So let's select 12.
Then click on slice and then click on apply button in the top right?
So I guess we don't have to help, so we need to cut one more time.
I'm really apologize for that.
33456789
1011.
So we have 11 I'm really apologize for that.
11.
And then click on slice.
Then click on apply.
And let's select the game view one more time.
And let's go to that spreadsheet.
And then click on this arrow in order to see the individual.
So what we're going to do now we're going to select our square game object or this rectangle rectangular
square.
So let's select that and we're going to move over to Spriterenderer component.
And we need to replace this sprite.
As you can see sprite.
And it says square.
So we're going to replace this one.
So let's select the first sprite or any of them and drag it over to this slot.
And as soon as we drag it now we are able to see.
But the problem is that it's kind of a same stretch in the y axis.
So we will go to transform then scale.
And in the y we're going to put one.
And we can see that this sprite just looking to the left right direction.
And we just want to flip this anime game object to the left direction to do that.
To do that, we can simply move over to Sprite Renderer and we're going to flip the x axis.
Or you can simply say horizontally, and we're going to drag this anime game object a little bit up.
So let's select the move tool from our scene view, and let's move it up in the y axis.
And we need to resize our box Collider 2D as well.
To do to do that let's go to Box Collider 2D.
And let's click on this Edit Collider.
And we're going to edit the Collider as the size of our anime game object.
Sorry, we need to edit our collider and I guess we cannot edit.
So we need to drag it up.
Or we can simply move over to this offset and size and we can just make this.
And this one seems pretty much fine.
And I'm going to drag it over here and let's drag it here.
And we're going to make the opposite sorry offset.
We're going to set to zero.
And the x I'm going to make it something like this much.
Just play around with these values.
And then we're going to get.
So I'm going to do 1.2.
And this 1.2 seems pretty much good number.
And this is fine.
And we're going to make this anime game object a prefab as well.
So let's select the anime GameObject in the hierarchy.
And we're going to drag it over to this uh prefabs folder in order to make it prefab.
And we're going to make the animation.
Uh, basically we need to make our animation, which will be the ideal one as well as we're going to
have the run animation.
Sorry, we're going to have the fire animation of this anime game object as well.
But before we do, let's, uh, uh, let's split those sprite individually.
So I'm gonna move over to that folder and let's select the attack one.
Uh, attack one or attack two.
So I'm going to select my attack one.
Let's go to Inspector.
Click on Sprite Editor and we're going to slice individual.
So we're going to choose pixel per unit to 16 and filter mode to point filter.
Let's click on this apply.
Let's go to a Sprite Editor tab.
And we're gonna slice individually.
So I'm going to click on this slice.
And we're going to select Read by cell count.
And count how many columns and rows it has.
So it has three columns and one row.
And also we're gonna have the shooting animation clip.
So we have it over here.
So let's select that spreadsheet.
Go over to Inspector.
Let's just split this one individually as well.
So we're going to make pixel per unit to 16 filter mode to point filter click on apply.
And let's slice individually.
And we're going to slice it for.
Let's click on this slice and then apply.
and we are ready to make those animation by now.
So let's select the game view once again over here.
And we're going to make it in a fast way.
The animation.
And in order to make the animation in a fast way, basically what you have to do, you need to select
the individual sprite and you need to drag it on top of this anime GameObject in the hierarchy.
So we're going to make the idle animation first.
So let's select the idle sprite and then click over here to see the individual sprite.
And we're going to select all of this sprite.
But before we do let's create an animation folder.
Basically we're going to create a anime animation folder and anime animation subfolder.
You can simply say we're going to create that, and we're going to place all of the anime animation
into that folder to keep our project clean.
So let's go to Project App Assets and then animation folder.
And let's create a subfolder by right click create and then folder.
And we're going to name this folder to something like Anime animation.
So we're going to call it anime underscore animation.
And we're going to place all of the anime animation into this anime and underscore animation folder.
And let's also create a sub animation.
And we're going to call that animation to anime one animation because we're going to have multiple enemies.
So we're gonna have multiple enemies animation.
So that's why we're going to create another sub folder for our this anime.
So let's right click on this anime underscore animation.
Let's create folder.
And we're going to name this folder to something like anime one animation.
So anime anime one underscore animation folder.
And let's hit enter in order to create that.
Now let's move over to that spreadsheet and we're going to select all of the individual sprite by holding
down shift.
And then drag it over to this anime GameObject in the hierarchy.
And it's going to make the animation right away.
So we need to choose a folder where we want to place our animation.
We do know we created the anime animation folder in our assets folder.
So let's move over to assets and we can see animation folder.
So let's open that up.
And we're going to open up this anime animation folder.
And then this anime one and underscore animation because this will be the first animation.
So that's why and we can call this anime game object to something like anime one as well.
It's basically totally up to you.
So we have to name the animation what we want to name it.
So I'm going to call anime one underscore idle animation.
And let's click on this save.
And now if we select our anime then go over to animation tab and then click on this play button.
We can see animation is playing over again and again which is the ideal one.
So we need to create another animation which will other animation as well, which is the animation clip
of this anime game object as well as we're going to create the heart a animation of this anime game
object.
But before we do, I'm going to name this enemy to something like enemy one game object.
So I'm going to name it to enemy one.
Let's go to overrides and then click on this Apply All.
And in order to change in Enemy game Object prefab as well.
So we're going to make the other animation which will be the fire or the shooting one.
So let's go to project tab E to animation.
And let's select the shoot a sprite sheet.
And let's click over here.
And we're going to select all of the animation by holding down basically individual sprite by holding
down shift.
And then drag it over to this enemy GameObject in the hierarchy.
And sorry, we just forgot to just name it to something like enemy one, so I'm going to call it enemy
one and this is fine now.
So sorry we we not able to name it.
Sorry I'm really apologize for that.
And now it's fine.
So now let's select all of the sprite sheet of all of the individuals part of this shooting animation,
and we're going to drag it over top of this anime, one GameObject in the hierarchy in order to make
the animation right away.
So let's go to assets anime, animation, anime, animation.
Then this and we're going to name this animation clip to something like anime one underscore sorting.
Because this is just going to be the sorting animation clip.
So I'm going to call it anime underscore shooting sorting.
And let's click on this save in order to create the animation right away.
And we also need to create the heart animation.
But before we do, let's have a look on the animation or the shooting animation of this anime game object.
So let's select the anime one GameObject in the hierarchy.
Let's go to animation tab and then click over here in order to choose that and we're not able to see
let's click on this play button.
And this is fine now.
And we uh we don't have the enemy under enemy one.
Underscore the idle animation clip.
We're going to create that one.
So we're going to select all of them.
Let's drag it over here.
Assets.
Animation.
Enemy one.
Enemy.
And this will be the idle one.
So let's have a look.
And now this is predefined.
And we need to adjust the collider as well.
So if I just click on this play button.
But we can just ignore that.
So let's create the heart animation by now.
So let's select the hardest sprite from here.
So over here we have let's click on Open sprite editor pixel per unit 16 point of filter.
And we're going to select individually.
So how many three five.
So we're going to put five columns and one row slice and apply.
And let's let's select that sprite sheet.
And let's click on this arrow.
And we're going to select all of the individual sprite of heart animation sprites, and let's drag it
over to this anime game object enemy one GameObject in the hierarchy.
Let's go to assets and over here and this is gonna we're gonna call this animation clip two enemy one
underscore heart or heart animation simply.
And let's click on save.
And now we can play this one as well.
So let's click on this.
As you can see Heart Animation Clip is just playing over again and again.
And we can click on this play button in order to see the animation as well.
When the game starts, I'm gonna make my player speed a little bit slow.
So let's click on this play button so we can just able to see that.
And I'm going to make my player speed a little bit slow.
So I'm going to select my player game object.
And in player skip I'm going to make the speed something like it's already slow.
We don't wanna make it more slow.
So let's click on this play button instead.
So let's have a look on this.
And now, as soon as the game started, the fire animation is just playing over again and again.
So we need to do instead of playing the fire animation clip, we need to play the idle animation clip
of this anime game object.
So let's get out of play mode.
But before we do, let's create, uh, basically let's add up rigidbody 2D to this anime game object
as well.
So we're going to have the uh, you can say, uh, gravity.
So let's click on this add component in the inspector.
And we're going to attach a rigid body 2D.
And we're going to make the gravity scale to something like three and collision detection to continuous.
And we're going to freeze the rotation about z axis.
If we just don't do it.
And then go to transform then rotation and play around with z axis As you can see, it's gonna rotate
like this.
So stop.
To stop doing this, we need to freeze the rotation about z axis.
So I'm going to set again to zero in z rotation.
And make sure you just go to uh basically click on this rigid body and then freeze the rotation about
z axis.
And also make sure you just, uh, choose this collision detection to continuous.
And I'm going to choose interpolate to interpolate to basically make it a little bit smooth.
Or you can just ignore as well.
Let's go to overrides and then apply all.
And now what we need to do, we need to make the idle animation clip is the default one.
So if I select my anime one game object and then move over to animator tab, we can see we have three
animation clip.
We have shooting one idle and the heart.
So we do want this idle animation clip to be the default one.
So we're gonna right click on this anime one underscore idle.
And we're going to click on this set as layer default state.
Now if I just click on this play button in the top, you will see this animation clip just going to
play right after the game start.
Because we just made this animation clip is the default one.
So that's why it's going to play right after the game starts.
As soon as the game starts, we can see enemy one is now playing the idle animation clip over again
and again, and we can take a look in this animator tab as well by scrolling our mouse to zoom in or
zoom out.
So we also need to make transition from this idle to shooting as well as the heart.
So let's get out of play mode.
I hope you get the idea that how you can make the animation in a fast way, and if you just add in trouble
to finding this animation and then animator tab, then you basically need to go to window in the top.
Then you can see over here animation.
And the shortcut key is control six as well as the animator tab.