WEBVTT

00:00.480 --> 00:02.240
Uh, let's choose a condition.

00:02.240 --> 00:04.240
So we're going to select this transition.

00:04.400 --> 00:05.840
Let's go over to Inspector.

00:05.840 --> 00:07.720
Scroll down to the condition.

00:07.720 --> 00:09.520
So what we will do for it.

00:09.560 --> 00:11.680
We're going to choose a trigger condition.

00:11.680 --> 00:15.200
To do so let's move over to animator tab then parameter.

00:15.200 --> 00:16.720
Let's click on this plus icon.

00:16.720 --> 00:21.000
Let's choose a trigger and we can call this one attack one.

00:21.320 --> 00:22.720
Attack one.

00:23.080 --> 00:25.280
And let's go over to Inspector.

00:25.320 --> 00:27.080
Let's choose that condition.

00:27.080 --> 00:33.440
So if we just trigger this attack one parameter then it's going to play this attack one animation clip.

00:33.440 --> 00:37.480
As you can see in Inspector we have chosen that condition.

00:37.480 --> 00:38.320
So that's why.

00:38.720 --> 00:41.640
And we also need to make transition back to idle.

00:42.040 --> 00:44.160
So let's right click on this attack one.

00:44.160 --> 00:46.200
Let's make transition back to idle.

00:46.200 --> 00:48.360
And let's select this transition.

00:48.360 --> 00:49.920
Let's go over to Inspector.

00:50.120 --> 00:56.800
And we're going to leave the has exit time because uh we want to play our 100% animation clip of this

00:56.840 --> 00:57.440
attack one.

00:57.440 --> 01:03.410
And after that we want to uh, we just want to go back idle animation clip.

01:03.410 --> 01:09.330
So that's why exit time we're going to choose one basically means 100% and transition duration we're

01:09.330 --> 01:10.730
going to make zero.

01:10.890 --> 01:14.250
And if we scroll down we're not going to choose any condition.

01:14.250 --> 01:20.970
So it's automatically just gonna move over to this idle animation clip right after playing this attack.

01:20.970 --> 01:23.290
One animation clip 100%.

01:23.570 --> 01:28.970
And we we also need to make transition from this attack one to this one.

01:28.970 --> 01:30.450
So let's right click on it.

01:30.450 --> 01:32.330
Let's make transition to run.

01:32.370 --> 01:38.890
If we start moving then we need to play, uh, play the run animation clip right away instead of playing

01:38.890 --> 01:40.170
this attack one.

01:40.170 --> 01:42.010
So we're gonna choose that condition.

01:42.010 --> 01:44.970
And for this we're gonna untag this as exit time.

01:45.010 --> 01:51.450
As soon as we gonna start moving to the left or right direction, then, uh, we need to play the run

01:51.490 --> 01:54.530
animation clip right away instead of the attack one.

01:54.530 --> 01:59.770
So that's why we just uncheck this has exit time and transition duration.

01:59.770 --> 02:01.090
We will set it to zero.

02:01.090 --> 02:06.890
And if we scroll down we're not gonna choose any condition, so it's automatically just going to play

02:06.890 --> 02:08.290
the run animation clip.

02:08.450 --> 02:15.690
If we start moving and we're gonna do the same thing from this attack one to our, uh, this player

02:15.690 --> 02:18.650
jump and we can just readjust.

02:18.690 --> 02:24.930
So so let's arrange this, like, I hope like this, I guess.

02:25.530 --> 02:26.490
And this is.

02:26.530 --> 02:27.450
Seems fine.

02:27.610 --> 02:29.770
And let's choose from this player.

02:29.770 --> 02:34.570
Attack one to jump, and let's do the same thing as we have done with run.

02:34.570 --> 02:41.170
So basically we uncheck this has exit time because as soon as we're gonna press down space key on our

02:41.170 --> 02:41.810
keyboard.

02:41.970 --> 02:46.250
And if we're playing the attack one animation clip, then we need to stop playing it.

02:46.290 --> 02:50.170
Instead of we need to play the jump animation clip right away.

02:50.170 --> 02:54.930
So that's why we're gonna uncheck this has exit time transition duration.

02:54.930 --> 02:56.290
We're gonna set it to zero.

02:56.530 --> 02:59.210
And we're not gonna choose any condition for it.

02:59.210 --> 03:07.740
So it's just gonna play automatically if we just uh, set this jump parameter to true or Or we just

03:07.740 --> 03:09.460
play the jump animation clip.

03:09.780 --> 03:10.300
Sorry.

03:10.820 --> 03:13.620
Uh, basically we're gonna play the jump animation clip.

03:13.620 --> 03:17.860
So let's make a make transition to attack three, attack one as well.

03:18.020 --> 03:22.380
So let's right click on this player idle make Transition to Player Attack two.

03:22.540 --> 03:24.540
And let's choose this transition.

03:24.740 --> 03:30.500
And we're gonna uncheck this has exited has exit time and transition duration to zero.

03:30.780 --> 03:34.260
And if we scroll down we need to choose a condition for this.

03:34.300 --> 03:38.340
We're gonna choose is uh another trigger parameter for it.

03:38.340 --> 03:40.260
So let's move over to animator.

03:40.260 --> 03:43.620
Let's click on this plus icon then trigger in the bottom.

03:43.620 --> 03:46.340
And we're going to call this one attack two.

03:46.820 --> 03:50.060
And we're gonna choose this condition which is attack two.

03:50.380 --> 03:53.500
And we also need to make transition back to idle.

03:53.820 --> 03:55.020
So let's do it.

03:55.020 --> 04:01.540
And for since we standing at one position, that means we need to play the attack to 100%.

04:01.540 --> 04:04.620
And after that we need to play the idle animation clip.

04:04.620 --> 04:09.740
So that's why we're gonna choose the back transition and we're going to leave the has exit time and

04:09.740 --> 04:10.300
exit time.

04:10.300 --> 04:14.220
We're going to choose one means 100% and transition duration.

04:14.220 --> 04:15.700
We will set it to zero.

04:15.700 --> 04:21.300
And if we scroll down, we need to choose the, uh, basically we're not gonna choose any condition.

04:21.300 --> 04:23.620
So it's just gonna play automatically.

04:23.620 --> 04:25.260
Play your idle animation clip.

04:25.260 --> 04:30.940
Once our player attack to animation clip played 100%, then it's gonna move.

04:31.060 --> 04:33.860
It's gonna play the player idle automatically.

04:33.860 --> 04:38.540
So we also need to make transition from this player attack to our run.

04:38.540 --> 04:41.300
So let's make it, uh.

04:41.300 --> 04:48.100
So let's make it and let's, uh, we're gonna untick has exit time transition duration to zero.

04:48.100 --> 04:49.180
And let's leave it.

04:49.380 --> 04:53.620
And we're going to do the same thing from this player attack to player jump.

04:53.620 --> 04:54.860
So let's do that.

04:54.900 --> 04:59.140
Basically we doing the same thing as we have done with player attack one.

04:59.780 --> 05:06.060
So and take has exit zero and then and let's do the attack three.

05:06.100 --> 05:07.740
Now we have left.

05:09.140 --> 05:13.030
Uh so let's make, let's click on this plus icon trigger.

05:13.590 --> 05:16.510
And this will be attack three.

05:17.350 --> 05:19.750
And let's make transition.

05:22.350 --> 05:26.110
So two attack three.

05:26.870 --> 05:31.630
And let's make transition to our player charm.

05:34.790 --> 05:42.950
And and let's do so I hope you get the idea.

05:44.070 --> 05:51.510
And this is fine and I guess so.

05:51.550 --> 05:52.670
It's, uh done.

05:53.870 --> 05:55.350
So I hope you get the.

05:55.350 --> 06:00.390
It seems messy, but we need to just, uh, arrange that.

06:00.390 --> 06:05.630
And we also need to play the heart animation clip, but we're going to talk about it later.

06:05.870 --> 06:13.480
So if we just go ahead and then play, hit this play button in the top and try to trigger these parameters

06:13.480 --> 06:14.280
manually.

06:14.400 --> 06:16.960
This attack one, attack two, and attack three.

06:17.120 --> 06:19.920
You will see those animation just gonna play.

06:19.920 --> 06:25.880
If we trigger this attack one parameter manually, uh, we can, uh, we can see it's playing the attack

06:25.880 --> 06:27.280
one animation clip.

06:27.280 --> 06:33.480
And once it's played 100%, it's played this player idle animation clip automatically.

06:33.520 --> 06:37.560
Once our attack one animation clip played 100%.

06:37.560 --> 06:41.080
And if we trigger attack two parameter, we can see it's play.

06:41.120 --> 06:43.440
It's playing the attack two animation clip.

06:43.600 --> 06:49.040
And if we trigger this attack three parameter, it's playing the attack three animation clip.

06:49.360 --> 06:55.920
So we get a problem that uh, so the problem is that, uh, we also need to make transition from this

06:55.920 --> 06:58.960
player attack three to, uh, our player idle.

06:59.200 --> 07:05.160
So uh, or as you can see, it's stuck forever in this attack three animation clip.

07:05.160 --> 07:08.480
So we also need to make transition back to our idle.

07:08.480 --> 07:10.160
So let's get out of play mode.

07:10.160 --> 07:14.320
And let's right click on this attack three and make transition back to idle.

07:14.520 --> 07:16.480
And we're going to choose this transition.

07:16.480 --> 07:20.760
And let's leave the has exit time since we standing at one position.

07:21.160 --> 07:24.960
So we need to play the 100% animation clip of attack three.

07:25.000 --> 07:28.400
And after that we need to make transition to this player idle.

07:28.400 --> 07:32.960
So that's why we're going to leave this as exit time as check and exit time.

07:32.960 --> 07:37.600
We're gonna choose one means 100% and transition duration to zero.

07:37.600 --> 07:39.640
And we're not gonna choose any condition.

07:39.640 --> 07:46.280
So it's automatically just gonna play the idle animation clip once our attack three animation clip played

07:46.320 --> 07:47.320
100%.

07:47.320 --> 07:48.200
So let me show you.

07:48.240 --> 07:52.200
Let's click on this play button in the top in order to start our game.

07:52.360 --> 07:57.560
And let's try to trigger this attack three parameter, uh, manually.

07:58.880 --> 08:00.880
So let's have a look on this.

08:01.040 --> 08:07.280
So if I trigger this attack three as you can see now it's playing the attack three animation clip.

08:07.280 --> 08:12.480
And once it's played 100% it's played the player idle animation clip.

08:12.480 --> 08:16.490
Since we make transition back to idle as well.

08:16.650 --> 08:19.850
And if we set this parameter to true basically means check.

08:19.850 --> 08:22.050
We can see it's playing the jam.

08:22.050 --> 08:28.330
And if we uncheck basically say this jam parameter to false manually, we can see it's playing the player

08:28.330 --> 08:28.810
idle.

08:29.010 --> 08:34.170
And if we set this parameter to one it's playing the running animation clip.

08:34.170 --> 08:38.570
And if we set back to zero it's playing the player idle animation clip.

08:38.570 --> 08:45.370
So basically we need to uh trigger this parameter or we need to set this parameter, uh, through our

08:45.370 --> 08:45.890
code.

08:46.050 --> 08:52.050
Depending upon what player is doing, a player is started moving to the left or right direction.

08:52.050 --> 08:54.770
Then we need to set this parameter to one.

08:54.770 --> 08:57.250
So it's going to play the running animation clip.

08:57.250 --> 09:02.450
And if the player stops moving then we need to set back this parameter to zero.

09:02.570 --> 09:06.410
So it's going to play the idle animation clip as you can see.

09:06.410 --> 09:09.410
So we also need to make transition to this player heart.

09:09.410 --> 09:11.130
So let's get out of play mode.

09:11.130 --> 09:14.930
So what we're gonna do we're gonna make our player heart.

09:14.930 --> 09:19.650
So we will make it from, uh, from this player idol.

09:19.970 --> 09:22.170
Or we can just leave it.

09:22.170 --> 09:23.490
So let's leave that.

09:23.490 --> 09:29.890
So I hope you get the idea that how you can make a transition between this animation clip and how you

09:29.890 --> 09:36.610
can choose a condition or parameters in order to make transition between this animation clip and we

09:36.610 --> 09:42.170
need to set this parameter through our code depending upon what is player is doing.

09:42.210 --> 09:48.090
If we click the left mouse button, then we're gonna trigger any of this, uh, attack attack one,

09:48.090 --> 09:51.410
attack two, or attack three parameter any of them.

09:51.450 --> 09:56.770
Because basically we're gonna choose a random one and then we're gonna trigger it if we click the left

09:56.770 --> 10:02.490
mouse button and if we press down space key on our keyboard, then we're going to set this parameter

10:02.490 --> 10:03.090
to true.

10:03.130 --> 10:03.970
Basically check.

10:03.970 --> 10:04.770
And we don't know.

10:04.770 --> 10:10.330
And uh, we if we just set it it's gonna play the jump animation clip.

10:10.330 --> 10:16.170
So I hope you get the idea that how you can do it uh, through and we doing manually.

10:16.170 --> 10:18.850
So we need to do it via scripting.
