Now let's make our player animation.
So before we create our player animation, let's create a folder.
So we will head over to our project tab asset.
Let's right click there create folder.
And let's call this folder to something like animations animations.
And let's open this folder by double clicking on it.
Or you can simply right click on it.
And let's create another subfolder for this player animation.
Why?
Because we're gonna have anime animation as well as some other animation clips.
So that's why we will create a separate subfolders to keep our project clean and organized in an organized
way.
To organize our project, you can simply say, so let's right click on this animations folder.
Let's let's click on let's go to create then folder.
And let's call this folder to something like player underscore animations animation something like that.
And I guess sorry instead of calling animation I'm gonna to rename this, let's call it instead animation.
So we're going to place all of the player animation folder inside this play.
Sorry.
We will place all of the animation of this player game object inside this player underscore animation
folder.
So create to create the animation we need this animation tab.
So you can just simply move over to window in the top.
Then scroll down to the animation.
And you can see animation as well as the animator tab and the shortcut key which is Ctrl Plus six.
If you press down that, it's going to bring up the animation tab right away.
But instead of doing animation like this way, we're going to do it a different way.
And it's pretty much fast.
Basically what we have to do, we're going to move over to our project tab, then assets and then sprites
folder and then player folder.
And over there we can see we have our player idle sprite.
So let's find first.
Firstly we need to find it.
So let's find the idle one.
so we need to find it first.
Uh, so over here we have.
So click on this arrow in order to, uh, see the individual.
So we will select all of them by holding down shift uh, or holding down shift I guess uh, this one
is one okay.
So this spreadsheet sorry.
Not this one.
So click on this arrow in order to see the individual and select all of them by holding down shift.
And then drag it over to top of this player game object in the hierarchy.
So it's going to make the animation right away.
And now we have to choose a folder where we want to place our animation.
So we will go to top left we can see assets.
So let's click there in the top left and inside assets folder we we can see that we created this animation
folder.
So we will open that up by double clicking on it.
And we also created a folder called player underscore animation as you can notice.
So let's open that up folder as well.
And now we have to name the animation what we want to call it.
So this will be the ideal one.
So we're going to call this one player underscore idle.
So let's call it player underscore idle.
And then click on the save button in order to create the animation right away.
And now if I select my player GameObject in the hierarchy, then move over to animation tab and then
click on this play button.
We can see the idle animation is just playing over again and again, but the problem is that it seems
a little bit fast.
So what we can do, we can make spaces between this frame rate.
But before you do, make sure you click on this red button in animation tab animation tab in order to
record your animation.
Else it's not going to record at all.
So we're going to select like this.
And let's move it something like this.
And if we click on this play button by now we can see the animation is ready.
Fine.
And once you are satisfied, you can just click on this red button to capture the animation.
Or you can simply leave it.
It's automatically going to capture the animation.
Now we have to create the running attack and all of those animation, uh, animation.
So let's do it.
So now let's do the working one.
So before we do it we need to find it.
So I have it over here.
Uh, over here I have.
So let's select this sprite sheet.
Let's click on this open Sprite editor in Inspector.
And we need to slice individually.
Uh so we will click on slice in the top left.
And let's select automatic to create pixel count.
And let's count how many columns and rows we have.
So 367.
So we're gonna put seven columns and one row.
Let's click on this slice and then click on this apply button in the top right in Sprite Editor tab.
And let's select the game view once again.
And we will select all of the sprite.
But before you do, make sure you just click on this arrow in order to see the individual sprite.
And we we will select from the start to the end by holding down shift and select all of the individual
sprite by holding down shift, and then and then drag it over to top of this player GameObject in the
hierarchy in order to make the animation right away.
Sorry.
So we will do the same thing.
So firstly we will move over to assets animation player animation.
So this will be the working one or the running one.
So we're going to call it something like player underscore.
Let's call it run.
And let's click on this save.
And now if we select our player move over to animation tab.
Then click over here.
And then choose this Run Animation clip.
And then click on this play button.
We can see the running animation clip is playing over again and again, and we can see those animation
clip in animator tab as well.
So if I choose animator, we can see we have the player idle player run and all of this animation clip.
So we need to create other animation as well like jumping, falling, attacking.
So let's do it.
So I'm gonna do the jumping by now.
So let's see the jumping.
We have it over here.
So let's select the Spritesheet.
First go over to Inspector.
Let's click on this open Sprite editor.
Let's click on this slice and let's count three six columns.
So let's put six column one row.
Let's click on slice apply.
And we're going to do the same thing.
So let's drag it.
So this is the jumping one.
So we need we will go to assets in the top left.
And animation player animation.
This will be jump.
So we're going to call it player underscore jump.
Let's call it jump.
And if we move over to animation tab then select this jump.
We can play the animation clip.
As you can see let's create the attack animation clip.
Uh so we have multiple attack animation clip.
So we're gonna do uh do with all of this.
So let's select the first one.
Let's click on this open sprite editor.
Let's slice it so we can see six column and one row.
Let's put six column one row slice apply.
Let's drag it on top of this player game object in the hierarchy.
And we will go to assets in the top left.
Then animation player animation.
So this will be the first one.
So player underscore attack.
And we're going to call it player underscore attack one because this is the first animation clip of
attack.
So that's why.
And let's click on this save.
And now let's choose the second one.
But before we do if we select our player in the hierarchy then move over to animation tab.
Then click over here and make sure you select your player GameObject in the hierarchy.
Else you're not going to able to see it on your animation tab, so make sure you just do it.
So we're going to click over here Player Attack one.
And if we click on this play button we can see the attack animation clip.
So let's create another animation clip which will be attached to an attack three.
So let's choose.
Let's click on Sprite editor.
Let's slice it then apply and let's select individual.
Firstly click on this arrow in order to see the individuals.
And we will select all of them by holding down shift.
Let's drag it over to this player game object in order to create the animation right away.
Let's go to Assets Animation Player animation and this will be player underscore attack two animation
clip.
So let's click on save and we can test it out.
So this is our attack two.
Let's create the third one which will be attack three.
So let's select this so we can see we have 369 columns.
So we're going to put nine columns nine columns.
Let's click on slice Apply.
And we're going to select all of this.
And let's drag it over to this player GameObject in the hierarchy.
Let's move to Assets Animation Player Animation and this will be player Underscore attack three.
And let's click on this save button in order to uh order to create the animation clip and move over
to animation tab.
So this is the attack three.
Let's create the heart and the animation clip as well so we can create that.
Uh, so let's do it.
So let's find the heart one so we can see this is our heart one.
So we have two heart one.
We can choose any of these.
Uh so let's choose this one.
So let's click on Open Sprite Editor and we're going to slice it for slice Apply.
Then let's click on this and let's drag it over to this player game object assets animation player animation.
And this will be heart player underscore Score.
Heart.
And this seems now pretty cool.
And we can play that animation clip as well.
So if I choose the heart one.
So as you can see sorry, this is this is not the heart one.
Sorry.
We, uh, we have done some mistake.
So we dragged this one, which was the idol.
I really apologize for it.
So basically, what we have to do, we need to find this heart.
So to do so, let's select this one instead.
So we're going to slice for apply.
And let's click and let's select individuals.
Let's drag it up of this player game object.
Then we will go to assets animation player animation.
And we're going to replace this one with our This heart one.
So we're going to select that.
And let's click on the save button.
And it says player heart animation already exists.
Do you want to replace it.
Yes I want to replace it with this one.
So I'm going to click on this yes button as soon as we have chosen yes.
And if I select the game view and select this player in the hierarchy, move over to animation tab and
then choose this Heart Animation clip.
And then click on this play button.
As you can see, this animation is now playing over again and again.
So I hope you get the idea that how you can create the animation right away, and I don't want some
animation clip to be loop something like this heart uh, those attack I don't want those animation clip
to below.
So what you can do for it to stop it, we basically head over to we need to move over to this project
tab assets.
And we had uh, we basically need to move over to in, in which folder.
Uh, we just created those animation clip.
So we do know that we have done inside this animation folder animations folder in our assets folder.
So firstly we will move over to our project app assets animation and then this player animation folder.
And we can see all of the animation clip right over here we have this player underscore attack one,
attack two, attack three.
And this heart an idol walk jump.
And all of these and some animation clip I don't want to loop something like this.
Player attack one, attack two, and this attack three.
So I'm going to select all of them by holding down shift basically attack one, attack two, and attack
three, and then go over to Inspector in the top right and you can see loop time.
So I'm going to uncheck since I don't want this animation clip to loop.
And also I'm going to do the same thing with this heart one.
And I'm going to leave this player idle player charm and this player run.
We can just uncheck this player jump one and let's leave it it for now.
And we're going to take a look on it later.
And if we select our player in the hierarchy and we can see a plus icon became in this basically an
animator component attached to this player game object once we created those animation clip.
So this animator component is responsible for playing those animation clip as well as transition between
animation clip.
Uh, clip.
I hope you get the idea.
Uh, so what we have to do now, uh, so we basically need to move over to this overrides and then apply
all because the change we added this animator component and we can see the plus icon.
So if I move over to my project app assets and then prefabs folder and open up this player prefab by
double clicking on it, uh, and then go over to Inspector.
As you can see, we cannot able to see that animator component which is attached, uh, attached to
this player game object in the hierarchy.
Uh, we cannot notice inside this prefab mode.
Inside prefab mode.
So what we need to do, we basically need to go back.
So in hierarchy you can see the back arrow.
So just click there in order to go back and we need to select our player, then go over to Inspector
Overrides and then apply all.
And as soon as we click Apply All.
Now this animator component is also attached in this player GameObject prefab as well.
To check it, we will open up the player prefab by double clicking on it, and if we move over to Inspector,
we can see by now this animator component is attached to this player GameObject prefab as well.
So I hope you get the idea that the changes you made are made.
And if you just move over to overrides and then apply all, so the changes will also be saved into this
player GameObject prefab as well.
So basically that is the thing.
So I hope you get the idea then how you can create the animation and make sure you always, uh, go
to Inspector Overrides and then apply all if you change anything inside this player GameObject components.
So the change is just going to be saved.
And I'm gonna press down Ctrl S on my keyboard in order to save my project.