Uh, let's choose a condition.
So we're going to select this transition.
Let's go over to Inspector.
Scroll down to the condition.
So what we will do for it.
We're going to choose a trigger condition.
To do so let's move over to animator tab then parameter.
Let's click on this plus icon.
Let's choose a trigger and we can call this one attack one.
Attack one.
And let's go over to Inspector.
Let's choose that condition.
So if we just trigger this attack one parameter then it's going to play this attack one animation clip.
As you can see in Inspector we have chosen that condition.
So that's why.
And we also need to make transition back to idle.
So let's right click on this attack one.
Let's make transition back to idle.
And let's select this transition.
Let's go over to Inspector.
And we're going to leave the has exit time because uh we want to play our 100% animation clip of this
attack one.
And after that we want to uh, we just want to go back idle animation clip.
So that's why exit time we're going to choose one basically means 100% and transition duration we're
going to make zero.
And if we scroll down we're not going to choose any condition.
So it's automatically just gonna move over to this idle animation clip right after playing this attack.
One animation clip 100%.
And we we also need to make transition from this attack one to this one.
So let's right click on it.
Let's make transition to run.
If we start moving then we need to play, uh, play the run animation clip right away instead of playing
this attack one.
So we're gonna choose that condition.
And for this we're gonna untag this as exit time.
As soon as we gonna start moving to the left or right direction, then, uh, we need to play the run
animation clip right away instead of the attack one.
So that's why we just uncheck this has exit time and transition duration.
We will set it to zero.
And if we scroll down we're not gonna choose any condition, so it's automatically just going to play
the run animation clip.
If we start moving and we're gonna do the same thing from this attack one to our, uh, this player
jump and we can just readjust.
So so let's arrange this, like, I hope like this, I guess.
And this is.
Seems fine.
And let's choose from this player.
Attack one to jump, and let's do the same thing as we have done with run.
So basically we uncheck this has exit time because as soon as we're gonna press down space key on our
keyboard.
And if we're playing the attack one animation clip, then we need to stop playing it.
Instead of we need to play the jump animation clip right away.
So that's why we're gonna uncheck this has exit time transition duration.
We're gonna set it to zero.
And we're not gonna choose any condition for it.
So it's just gonna play automatically if we just uh, set this jump parameter to true or Or we just
play the jump animation clip.
Sorry.
Uh, basically we're gonna play the jump animation clip.
So let's make a make transition to attack three, attack one as well.
So let's right click on this player idle make Transition to Player Attack two.
And let's choose this transition.
And we're gonna uncheck this has exited has exit time and transition duration to zero.
And if we scroll down we need to choose a condition for this.
We're gonna choose is uh another trigger parameter for it.
So let's move over to animator.
Let's click on this plus icon then trigger in the bottom.
And we're going to call this one attack two.
And we're gonna choose this condition which is attack two.
And we also need to make transition back to idle.
So let's do it.
And for since we standing at one position, that means we need to play the attack to 100%.
And after that we need to play the idle animation clip.
So that's why we're gonna choose the back transition and we're going to leave the has exit time and
exit time.
We're going to choose one means 100% and transition duration.
We will set it to zero.
And if we scroll down, we need to choose the, uh, basically we're not gonna choose any condition.
So it's just gonna play automatically.
Play your idle animation clip.
Once our player attack to animation clip played 100%, then it's gonna move.
It's gonna play the player idle automatically.
So we also need to make transition from this player attack to our run.
So let's make it, uh.
So let's make it and let's, uh, we're gonna untick has exit time transition duration to zero.
And let's leave it.
And we're going to do the same thing from this player attack to player jump.
So let's do that.
Basically we doing the same thing as we have done with player attack one.
So and take has exit zero and then and let's do the attack three.
Now we have left.
Uh so let's make, let's click on this plus icon trigger.
And this will be attack three.
And let's make transition.
So two attack three.
And let's make transition to our player charm.
And and let's do so I hope you get the idea.
And this is fine and I guess so.
It's, uh done.
So I hope you get the.
It seems messy, but we need to just, uh, arrange that.
And we also need to play the heart animation clip, but we're going to talk about it later.
So if we just go ahead and then play, hit this play button in the top and try to trigger these parameters
manually.
This attack one, attack two, and attack three.
You will see those animation just gonna play.
If we trigger this attack one parameter manually, uh, we can, uh, we can see it's playing the attack
one animation clip.
And once it's played 100%, it's played this player idle animation clip automatically.
Once our attack one animation clip played 100%.
And if we trigger attack two parameter, we can see it's play.
It's playing the attack two animation clip.
And if we trigger this attack three parameter, it's playing the attack three animation clip.
So we get a problem that uh, so the problem is that, uh, we also need to make transition from this
player attack three to, uh, our player idle.
So uh, or as you can see, it's stuck forever in this attack three animation clip.
So we also need to make transition back to our idle.
So let's get out of play mode.
And let's right click on this attack three and make transition back to idle.
And we're going to choose this transition.
And let's leave the has exit time since we standing at one position.
So we need to play the 100% animation clip of attack three.
And after that we need to make transition to this player idle.
So that's why we're going to leave this as exit time as check and exit time.
We're gonna choose one means 100% and transition duration to zero.
And we're not gonna choose any condition.
So it's automatically just gonna play the idle animation clip once our attack three animation clip played
100%.
So let me show you.
Let's click on this play button in the top in order to start our game.
And let's try to trigger this attack three parameter, uh, manually.
So let's have a look on this.
So if I trigger this attack three as you can see now it's playing the attack three animation clip.
And once it's played 100% it's played the player idle animation clip.
Since we make transition back to idle as well.
And if we set this parameter to true basically means check.
We can see it's playing the jam.
And if we uncheck basically say this jam parameter to false manually, we can see it's playing the player
idle.
And if we set this parameter to one it's playing the running animation clip.
And if we set back to zero it's playing the player idle animation clip.
So basically we need to uh trigger this parameter or we need to set this parameter, uh, through our
code.
Depending upon what player is doing, a player is started moving to the left or right direction.
Then we need to set this parameter to one.
So it's going to play the running animation clip.
And if the player stops moving then we need to set back this parameter to zero.
So it's going to play the idle animation clip as you can see.
So we also need to make transition to this player heart.
So let's get out of play mode.
So what we're gonna do we're gonna make our player heart.
So we will make it from, uh, from this player idol.
Or we can just leave it.
So let's leave that.
So I hope you get the idea that how you can make a transition between this animation clip and how you
can choose a condition or parameters in order to make transition between this animation clip and we
need to set this parameter through our code depending upon what is player is doing.
If we click the left mouse button, then we're gonna trigger any of this, uh, attack attack one,
attack two, or attack three parameter any of them.
Because basically we're gonna choose a random one and then we're gonna trigger it if we click the left
mouse button and if we press down space key on our keyboard, then we're going to set this parameter
to true.
Basically check.
And we don't know.
And uh, we if we just set it it's gonna play the jump animation clip.
So I hope you get the idea that how you can do it uh, through and we doing manually.
So we need to do it via scripting.