WEBVTT

00:00.470 --> 00:00.950
Hello guys.

00:00.950 --> 00:01.940
Welcome to the video.

00:01.940 --> 00:04.550
In this one we are going to make another cool enemy.

00:04.550 --> 00:05.900
It's going to be a rhino.

00:05.900 --> 00:09.560
From this reference over here.

00:09.590 --> 00:12.110
It's pretty simple to make a very fun one I think.

00:12.110 --> 00:13.370
So that's what we're going to do.

00:13.400 --> 00:16.490
As you can see, the logic here should be very simple.

00:16.490 --> 00:22.460
And we did basically we know all of the script to do this, like we did coding for the similar functionality

00:22.460 --> 00:25.340
or even it was even more complex than this one.

00:25.340 --> 00:27.560
So let's go ahead and set up the Rhino.

00:28.070 --> 00:29.420
How are we going to do this?

00:30.140 --> 00:33.020
First I want to make prefab for the chicken.

00:33.050 --> 00:34.940
Then I want to remove the chicken.

00:34.940 --> 00:37.490
And this time I actually want to be smart.

00:37.490 --> 00:41.330
I don't want to waste time on setting up the entire game object.

00:41.330 --> 00:47.360
So I'm going to take the enemy mushroom, duplicate it, bring it down over here.

00:47.690 --> 00:51.650
Then I'm going to do prefab unpack completely.

00:51.800 --> 01:00.260
Change this to enemy rhino, and we're going to remove enemy rhino script and other things we just need,

01:00.260 --> 01:01.970
so we're not going to change them much.

01:01.970 --> 01:05.570
Let's go to graphics enemies.

01:05.900 --> 01:10.220
Uh, Rhino, we need to make sure these haven't pixel per unit 16.

01:10.220 --> 01:12.410
Mine already do, so it's fine.

01:12.440 --> 01:18.770
Then I'm going to open enemy Rhino, take one of the sprites and drag them to the sprite renderer over

01:18.770 --> 01:21.050
here so it will change the look.

01:21.080 --> 01:21.860
Nice.

01:21.890 --> 01:23.840
Now let's change Collider as well.

01:23.840 --> 01:27.140
We can just reset Collider over here.

01:27.140 --> 01:30.110
It's quite big, so I'm going to reduce it to something like.

01:30.110 --> 01:33.110
So yeah this should be good.

01:33.530 --> 01:37.370
And then we need damage trigger which we also can adjust.

01:37.580 --> 01:40.460
It's supposed to be wider than the regular collider.

01:40.460 --> 01:46.190
Actually it can be the same size as the regular collider because enemy I mean player does not collide

01:46.190 --> 01:50.810
with this collider over here on the enemy because we disable collision between enemy and players.

01:50.840 --> 01:53.480
Only the size of this collider matters.

01:53.480 --> 01:57.960
So yeah, we can just basically make it whatever we want to have here.

01:57.990 --> 02:00.180
Just define the damage shape.

02:00.840 --> 02:01.740
Nice.

02:01.770 --> 02:05.820
And that is basically half job done for the enemy right now.

02:05.850 --> 02:11.400
Let me bring it down here and let's go to animator enemies over here.

02:11.430 --> 02:13.440
Going to make folder for the chicken.

02:14.790 --> 02:15.720
Chicken.

02:19.110 --> 02:21.630
Then let's make folder for the rhino.

02:22.290 --> 02:27.180
So Rhino going to have a new animator controller because you have one more animation.

02:27.180 --> 02:30.630
Not like other enemies that had three animations.

02:30.630 --> 02:34.860
Let's do enemy Rhino.

02:34.860 --> 02:35.880
How how it was.

02:35.880 --> 02:38.040
I forgot how it was on other enemies.

02:38.910 --> 02:51.570
Enemy okay, should it be enemy runner Rhino AC okay, let's drag it here to the enemy Rhino.

02:51.600 --> 02:54.630
Now we can create a bunch of animations for this guy.

02:54.960 --> 02:59.010
Let's create new clip animations enemies.

02:59.010 --> 03:02.640
Right now this will be enemy Rhino idle.

03:03.420 --> 03:06.750
Going to go to graphics of the Rhino.

03:06.870 --> 03:07.800
It is over here.

03:07.830 --> 03:09.120
Going to take idle sprites.

03:09.120 --> 03:10.290
Drag them here.

03:10.290 --> 03:12.000
Sample rate 20.

03:12.060 --> 03:13.470
Pretty simple stuff to do.

03:13.500 --> 03:17.850
Let's make new clip enemy Rhino move.

03:18.060 --> 03:20.940
This one going to be for the run animation.

03:21.510 --> 03:23.070
Sample rate 20.

03:23.580 --> 03:27.720
Then we need enemy hit so we can kill him.

03:28.290 --> 03:29.460
Let's take this.

03:29.490 --> 03:30.360
Put them here.

03:30.360 --> 03:31.620
Sample rate 20.

03:31.620 --> 03:36.600
And we need one more enemy Rhino hit wall.

03:36.600 --> 03:41.850
So when he hits the wall we're going to play different animation with this sprites.

03:41.850 --> 03:43.590
Sample rate 20.

03:43.620 --> 03:53.160
Now before I forgot let's go to animations of the Rhino select hit wall and the hit and uncheck Loop

03:53.190 --> 03:53.640
time.

03:53.640 --> 03:56.850
And also this should be enemy rhino hit.

03:58.740 --> 04:02.760
Okay, so this not having a loop time, now we can set up the animator.

04:02.790 --> 04:07.470
I think we can make a blend tree because that is the cleanest way I can think of.

04:08.400 --> 04:11.070
Uh, let me do Blend Tree.

04:11.100 --> 04:15.090
I'm gonna name it as Idle Move.

04:15.330 --> 04:16.050
Nice.

04:16.050 --> 04:17.790
Let's make it by default.

04:17.790 --> 04:19.770
And let's go inside of this blend tree.

04:19.800 --> 04:22.800
This should have x velocity.

04:23.520 --> 04:26.580
And we need three motion fields.

04:28.080 --> 04:32.130
One going to be Rhino move.

04:32.130 --> 04:34.560
And I'm going to copy Rhino here so I can use it.

04:35.010 --> 04:44.130
Then Rhino idle and Rhino move threshold minus one zero one.

04:44.130 --> 04:45.150
And we know it's going to work.

04:45.150 --> 04:46.470
So I'm not going to check it.

04:46.560 --> 04:50.190
Let's go back now for the hit.

04:50.370 --> 04:55.530
Supposed to be available from any state because now we have a bunch of animations, but heat wall should

04:55.530 --> 04:57.480
be available only from Idle Move.

04:57.480 --> 05:06.570
So I'm going to go here and set up the new condition actually boolean hit wall just like that.

05:06.570 --> 05:07.680
It's going to be fine.

05:08.400 --> 05:13.680
Let's transfer here if it's a true and check exit time transition duration zero.

05:13.680 --> 05:14.460
Nice.

05:14.490 --> 05:18.990
Now we're going to transfer back when heat wall is false.

05:20.490 --> 05:21.210
Has exit time.

05:21.210 --> 05:23.640
Uncheck transition duration zero.

05:23.670 --> 05:26.760
And then this animation should be triggered from any state.

05:26.760 --> 05:29.880
So I'm going to make a trigger heat.

05:30.150 --> 05:33.330
And we're going to transfer from any state to enemy hit.

05:33.600 --> 05:39.090
And over here we should have condition of heat transition duration zero.

05:39.090 --> 05:42.600
And make sure to uncheck can transit to self over here.

05:42.630 --> 05:44.220
This is important.

05:45.180 --> 05:51.730
Now we don't need any other transitions over here I believe this is just fine because once we transfer

05:51.760 --> 05:54.100
to enemy hit, he's going to die anyway.

05:54.550 --> 05:55.120
All right.

05:55.150 --> 05:55.870
Cool cool cool.

05:55.870 --> 05:57.040
So we have animator.

05:57.040 --> 06:00.310
We have everything, like almost everything ready.

06:00.310 --> 06:03.850
And now we're going to need a script for Enemy Rhino.

06:04.300 --> 06:08.920
I'm going to make a new C sharp script enemy Rhino.

06:10.030 --> 06:11.410
And let's open this.

06:18.610 --> 06:24.190
Now this one going to have a very simple functionality, but still we need to inherit from the enemy.

06:24.190 --> 06:30.730
And actually, I think we can take the script from mushroom and chicken, place them here and then edit

06:30.730 --> 06:32.650
the script to our needs.

06:32.650 --> 06:39.400
First let's go to enemy chicken and take these two methods on draw Gizmos and handle collision because

06:39.400 --> 06:41.950
we're going to need to detect the player.

06:42.160 --> 06:46.240
Now we can see we need detection range and boolean player detected.

06:46.240 --> 06:47.950
And here I want to show you a trick.

06:47.980 --> 06:52.540
You can press alt enter and click Generate Variable over here.

06:52.570 --> 06:53.920
Generate field.

06:54.970 --> 06:56.680
Going to make a variable for us.

06:56.680 --> 06:58.090
Same here.

06:58.570 --> 07:00.220
It's a bit different from what we need.

07:00.250 --> 07:02.200
We could use raycast here to do by the way.

07:02.200 --> 07:03.700
But let's use boolean.

07:03.880 --> 07:05.350
And this should be float.

07:05.350 --> 07:09.220
And let's make them as serialized field over here so we can see it.

07:09.220 --> 07:10.900
And we need a header.

07:10.930 --> 07:11.650
Rhino.

07:11.650 --> 07:12.820
Details.

07:12.880 --> 07:14.260
Nice.

07:15.160 --> 07:18.730
Now this is almost everything that we need.

07:18.760 --> 07:23.620
And let's think about the logic here how it's going to work.

07:23.650 --> 07:25.060
Rhino going to stand.

07:25.060 --> 07:27.340
So from the start he cannot move.

07:27.370 --> 07:31.780
Once he sees the player he is going to move into player's direction.

07:31.780 --> 07:37.060
So we're going to make a method and it's going to be.

07:40.870 --> 07:43.960
Private void handle charge.

07:43.960 --> 07:46.780
And here we're going to manage the movement of the rhino.

07:46.810 --> 07:52.780
Of course if we cannot move, we're going to return and it's going to be like that by default.

07:53.170 --> 07:58.780
And if we can move, we're going to do our velocity equals to new vector two with a move speed multiplied

07:58.780 --> 08:00.040
by facing direction.

08:00.040 --> 08:02.560
And our velocity dot y over here.

08:02.560 --> 08:08.140
And I want to make him able to move if we detect in the player.

08:08.140 --> 08:16.690
So maybe in the handle collision over here we can do if player detected sorry player detected then make

08:16.840 --> 08:18.940
can move equals to true.

08:20.140 --> 08:21.370
Very nice.

08:21.400 --> 08:22.900
Let's save this.

08:22.900 --> 08:24.430
And this one.

08:24.430 --> 08:31.000
As it is now supposed to work, we only need to do overwrite, update and update.

08:31.000 --> 08:37.150
We need to do anim set float of the x velocity to the rb velocity dot x.

08:37.150 --> 08:42.670
And also we need to do handle collision and then handle charge.

08:43.270 --> 08:43.870
Sorry.

08:43.900 --> 08:45.280
Handle charge.

08:45.940 --> 08:46.630
Cool.

08:46.660 --> 08:48.070
Let's save this.

08:48.100 --> 08:49.840
Let's go back to unity.

08:55.570 --> 09:04.120
And over here, we can just place Rhino to the side somewhere here.

09:04.690 --> 09:08.440
Let's put the script on enemy rhino.

09:08.530 --> 09:11.410
Now we need to assign ground check.

09:11.410 --> 09:13.180
What is player?

09:13.210 --> 09:16.750
What is ground and damage trigger?

09:16.780 --> 09:17.800
Over here.

09:17.860 --> 09:19.060
Let's move ground.

09:19.090 --> 09:20.770
Check in front of the rhino.

09:20.890 --> 09:22.120
Like so.

09:22.930 --> 09:27.580
And I think we can increase wall check distance to something like this.

09:27.580 --> 09:33.520
So we can see the raycast outside of the collider itself, and probably would be a good idea to increase

09:33.520 --> 09:37.300
ground check distance as well, just in case.

09:37.300 --> 09:39.310
So I'm going to do 1.2 here.

09:39.340 --> 09:40.330
Nice.

09:40.330 --> 09:41.950
So that's all what we need.

09:41.980 --> 09:45.310
Now let's increase detection range here.

09:45.310 --> 09:46.960
I'm going to make it as 15.

09:46.960 --> 09:48.730
And if I'm not wrong.

09:48.760 --> 09:51.190
Range should stand their weight.

09:51.190 --> 09:54.070
And then when I jump in front of him, he'll run.

09:54.100 --> 09:56.440
Let's see this okay.

09:56.470 --> 10:00.550
He could run faster, by the way, but other than that, it's good.

10:00.580 --> 10:02.800
Now, what we need is to make him flip.

10:02.800 --> 10:06.880
If he is detecting the ledge because we don't want him to fall into the pit.

10:06.910 --> 10:08.950
If you like that functionality, you can keep it.

10:08.950 --> 10:11.200
But I'm going to show you how to stop it.

10:12.520 --> 10:14.650
So here, I'm going to do this.

10:14.650 --> 10:23.440
If no ground in front detected then we're going to do can move equals to false.

10:23.440 --> 10:25.450
So he will stop moving.

10:25.600 --> 10:30.310
Also we're going to do RB velocity equals to vector 2.0.

10:30.340 --> 10:34.240
So just in case we're going to reset his velocity so he will not fall off.

10:34.420 --> 10:37.510
And then we're going to flip him immediately.

10:37.510 --> 10:39.700
So he'll be ready to charge again.

10:39.700 --> 10:40.150
Yeah.

10:40.150 --> 10:42.460
This looks very nice and clean I like it.

10:44.720 --> 10:47.030
So now we're gonna save this.

10:47.060 --> 10:49.190
Let's go back to unity.

10:51.590 --> 10:53.750
And now I'm going to go to play mode.

10:53.780 --> 10:57.320
Gonna, uh, you know, aggro him.

10:57.350 --> 10:58.220
He's gonna run.

10:58.220 --> 11:01.070
And once he'll run to the ledge, he'll stop.

11:01.850 --> 11:03.050
Very cool.

11:03.170 --> 11:05.360
So how job is done here?

11:05.540 --> 11:07.880
But before we continue, I want to show you a bug.

11:07.880 --> 11:10.700
We have a very interesting one.

11:10.700 --> 11:12.260
Probably you should know about it.

11:12.260 --> 11:14.930
So at the moment, we have no functionality on the enemy.

11:14.930 --> 11:18.350
Rhino for the flip when he is detecting the wall.

11:18.380 --> 11:19.520
Nothing like that.

11:19.520 --> 11:23.000
I actually noticed this bug before, but I thought it's not that important.

11:23.000 --> 11:25.220
But now it is standing in our way.

11:25.220 --> 11:26.900
So I'm going to show you what it is.

11:26.900 --> 11:29.390
I'm going to agro right now again.

11:32.510 --> 11:38.210
And you'll see that when he reaches the wall, he's going to flip you.

11:38.300 --> 11:40.130
So what just happened?

11:40.160 --> 11:43.340
We don't have any wall World detected flip functionality.

11:43.370 --> 11:46.130
Why did he flip if we have only functionality?

11:46.160 --> 11:48.380
No ground in front detected.

11:50.360 --> 11:57.050
So this setup generally means that Unity's Thelma Collider will create colliders only along the visible

11:57.080 --> 12:02.270
boundaries of the tiles, and it will not cover the entire area.

12:02.270 --> 12:12.950
And it may happen that somehow when enemies are facing this side like so, when he stands somewhere

12:12.950 --> 12:18.260
close to the wall like so, there is no collider inside of this place.

12:18.260 --> 12:20.570
And because of that, he's not detecting anything.

12:20.600 --> 12:24.200
And because of that, he is flipping like it would be the edge.

12:24.680 --> 12:27.170
Luckily for us, it is super easy to fix.

12:27.170 --> 12:33.230
We can go ahead to the ground, choose geometry type and change it to polygons.

12:33.260 --> 12:35.720
Now it's going to fill up everything inside.

12:35.750 --> 12:42.410
Okay, now I'm going to make Rhino Faster, like maybe seven.

12:42.410 --> 12:46.730
And we're going to see what will happen when he charges to the wall again.

12:57.110 --> 12:57.650
Yeah.

12:57.650 --> 12:59.960
So now he does not flip, which is very good.

12:59.960 --> 13:06.410
That is what we need now at this point when he hits the wall, we need to change the animation for him

13:06.410 --> 13:08.750
and maybe do some sort of impact.

13:08.750 --> 13:11.690
So let's go to the script all the way above.

13:11.690 --> 13:21.080
We want to make serialized field Private Vector two impact power for that bounce effect when he hits

13:21.080 --> 13:21.800
the wall.

13:21.920 --> 13:25.130
Now let's go here and do something simple.

13:26.390 --> 13:31.970
If we'll detect it then we're going to use method hit wall.

13:33.710 --> 13:37.790
Or actually let's do wall hit okay.

13:37.790 --> 13:40.610
And I'm going to click alt enter generate method.

13:40.610 --> 13:44.000
And inside first of all we're going to set Boolean to true.

13:44.000 --> 13:50.180
So anim set bool of hit wall to true.

13:50.510 --> 13:53.180
Then we're going to give that impact velocity there.

13:53.180 --> 13:59.360
So I'm going to do RB velocity equals to new vector two impact power dot x.

13:59.360 --> 14:01.520
And usually we want to bounce rhino back.

14:01.520 --> 14:08.720
So we're going to do multiply by negative facing direction and impact power dot y.

14:09.080 --> 14:10.070
Super cool.

14:10.070 --> 14:12.290
So that's what we need to trigger the animation.

14:12.290 --> 14:15.590
We also need to exit the animation.

14:16.550 --> 14:19.880
And actually let's place this first over here.

14:19.910 --> 14:20.660
Yeah.

14:22.070 --> 14:24.050
Now we need to exit the animation.

14:24.050 --> 14:25.190
How are we going to do that.

14:25.190 --> 14:31.370
Well we can make a method and call it with the help of animation event in the end of the animation.

14:31.370 --> 14:33.380
So let's make a method private.

14:33.380 --> 14:40.380
Void charge is over and inside of this method we're going to do can move equals to false.

14:40.380 --> 14:46.980
So if you're not going to move again and we're going to do set bool hit wall false.

14:47.700 --> 14:51.540
That's almost everything that we need.

14:51.870 --> 14:54.330
Let's go ahead and see how does this work.

14:54.330 --> 14:57.480
And then I'm going to show you a couple of places where we can improve it.

14:58.050 --> 15:01.800
For now we just need to go to enemy right now hit wall.

15:06.900 --> 15:15.390
And maybe and maybe on the last frame or one frame after that we need to add event and call method enemy

15:15.390 --> 15:16.830
right now methods.

15:17.910 --> 15:21.210
Charge is over okay.

15:22.410 --> 15:23.730
This is supposed to work.

15:23.760 --> 15:25.680
I only want to add impact power.

15:25.680 --> 15:29.370
Let's give it maybe three on the X, four on the y.

15:30.180 --> 15:31.260
This is good.

15:31.440 --> 15:35.550
And now let's go ahead and charge him I mean trigger Him.

15:36.990 --> 15:40.290
Key still works the same.

15:40.290 --> 15:41.400
That's good to know.

15:41.400 --> 15:42.450
And then.

15:44.760 --> 15:45.630
You.

15:46.320 --> 15:47.400
This is very nice.

15:47.400 --> 15:48.180
I like how it looks.

15:48.180 --> 15:48.930
It's so fun.

15:48.930 --> 15:49.950
So much fun.

15:50.370 --> 15:53.850
And we probably need to flip him once he landed.

15:53.850 --> 15:55.410
I don't want to flip him immediately.

15:55.410 --> 16:00.090
That will look weird, but maybe with a little bit of delay is going to be nice.

16:00.720 --> 16:03.840
Um, let's go to enemy right now.

16:03.840 --> 16:12.210
And over here we're going to do invoke and name of flip with a delay of one second.

16:12.450 --> 16:12.750
Yeah.

16:12.750 --> 16:15.000
This will help us a lot.

16:15.090 --> 16:26.490
And, um, I think we need to go over here and make him a variable serialize field.

16:28.290 --> 16:30.660
Private float, max speed.

16:30.690 --> 16:34.170
I want to increase his movement speed while he is running.

16:34.770 --> 16:39.720
And we're also going to need private float default speed so we can store the value.

16:39.750 --> 16:42.060
Let's override start method.

16:42.060 --> 16:46.920
And in the start we're going to do default speed equals to move speed.

16:47.070 --> 16:49.650
Now we have saved the value of the move speed.

16:49.650 --> 16:53.520
And here we need to do some sort of change rate that we're going to use.

16:53.520 --> 17:00.180
So let's do serialize field private float speed up rate.

17:00.660 --> 17:03.330
Yeah I'm going to make it 0.6 F by default.

17:03.990 --> 17:06.300
Should be not higher than one actually.

17:06.300 --> 17:12.150
Let's go over here and do move speed equals to default speed.

17:12.150 --> 17:17.490
And also when we hit the wall we're going to do move speed equals to default speed.

17:17.670 --> 17:19.170
And this is almost over.

17:19.170 --> 17:24.900
So maybe while we are here let's take this into a method extract method.

17:25.320 --> 17:29.910
Turn around something like that.

17:29.940 --> 17:30.210
Yeah.

17:30.240 --> 17:31.500
Like turn back.

17:34.230 --> 17:36.270
Good good, good good.

17:36.270 --> 17:44.190
And over here we can do something like move speed equals to move speed plus and time delta time multiplied

17:44.190 --> 17:45.270
by speed up rate.

17:45.270 --> 17:47.850
So this will increase move speed with time.

17:47.850 --> 17:54.030
And we just need to check if move speed is bigger or equals to maximum speed, then maximum speed equals

17:54.030 --> 17:55.020
to move speed.

17:55.230 --> 17:57.720
We also need to reset the move speed.

17:57.720 --> 18:02.040
Once we hit the wall or once we flip like turn around.

18:02.040 --> 18:04.650
So probably it's a good idea to do it here.

18:04.830 --> 18:08.280
Move speed equals to default speed.

18:08.280 --> 18:10.170
And on the wall hit as well.

18:10.170 --> 18:15.000
Let's do move speed equals to default hit I mean default speed.

18:15.030 --> 18:17.220
Also there is something I'm worried about.

18:17.250 --> 18:22.050
We never stop this velocity until the charge is over.

18:22.050 --> 18:28.410
So I'm afraid that this move speed will interfere with the impact we're doing over here.

18:31.480 --> 18:36.250
So instead of doing can move false over here, let me do it on the wall.

18:36.250 --> 18:38.530
Heat can move false.

18:38.560 --> 18:39.550
All right.

18:40.960 --> 18:46.870
And we're going to go back to unity here to make things faster for me I'm going to go to the tile palette

18:47.170 --> 18:50.590
and draw a small platform over here.

18:51.400 --> 18:55.630
It will be a bit faster because we don't have to run back after he runs to the ledge.

18:55.660 --> 18:57.490
Now let's select Rhino.

18:58.360 --> 18:59.890
Let's do his default move.

18:59.920 --> 19:04.690
Speed five and maximum speed maybe eight and speed up rate.

19:04.720 --> 19:05.890
Actually, let's increase it.

19:05.890 --> 19:08.650
Let's make it 1.5.

19:08.680 --> 19:09.490
Why not?

19:09.580 --> 19:14.380
Now we're going to go and trigger him and see the results.

19:17.290 --> 19:19.420
Very nice I like it.

19:21.520 --> 19:22.990
Oh my God, how do I.

19:23.680 --> 19:26.380
Yeah yeah.

19:26.410 --> 19:27.370
Looks good.

19:27.520 --> 19:31.000
We could try to make him heavier.

19:31.480 --> 19:36.790
We could try to make him heavier and increase his gravity scale.

19:36.790 --> 19:39.400
That would make him more bouncy, I believe.

19:39.430 --> 19:40.090
Let me just.

19:40.090 --> 19:41.200
Quickly.

19:42.580 --> 19:43.480
Maybe.

19:43.900 --> 19:45.340
How could I do this?

19:45.940 --> 19:47.500
Uh, on the player.

19:49.600 --> 19:53.230
I'm going to disable this killing functionality.

19:53.260 --> 19:56.740
Where is it for now?

19:56.740 --> 19:57.820
I just need to, like.

19:57.820 --> 19:58.660
I don't want to kill him.

19:58.660 --> 19:59.950
I want to see him run.

20:02.740 --> 20:04.330
Now let's go to play mode.

20:05.350 --> 20:06.430
Select him.

20:06.430 --> 20:08.080
Let's open rigidbody.

20:08.500 --> 20:12.190
Let's do gravity scale 3.5, for example.

20:12.190 --> 20:14.200
Let's see his bounce now.

20:15.460 --> 20:18.220
Oh that feels nice to see a nice.

20:18.220 --> 20:22.060
Let's try to increase it to something like five and eight.

20:25.690 --> 20:27.340
Yeah cool cool cool cool.

20:27.340 --> 20:28.090
Let's try.

20:28.120 --> 20:30.490
Maybe a bit less vertical.

20:33.400 --> 20:33.910
Yeah.

20:34.090 --> 20:35.080
So good.

20:35.110 --> 20:35.830
Right?

20:35.830 --> 20:37.120
So juicy.

20:38.080 --> 20:40.090
Cool, cool, I like it.

20:40.480 --> 20:42.460
I will increase it on the Y.

20:42.490 --> 20:43.750
Let me see again.

20:44.530 --> 20:45.130
Yo.

20:47.500 --> 20:48.730
What happened to him?

20:54.100 --> 21:01.180
Why does he flip there like an extra time buggy or something in a bug there?

21:01.210 --> 21:09.550
If I aggro him and I stand on the ledge over here while he is bouncing from the impact, he will detect

21:09.550 --> 21:12.370
the player and he'll try to enter charge again.

21:12.400 --> 21:15.010
And that's why we have that sort of an extra flip.

21:15.010 --> 21:17.380
So let's go to enemy right now.

21:18.520 --> 21:23.740
And over here we can detect the player only if can move equals to false.

21:26.420 --> 21:28.670
Oh, but we can move to false over here.

21:28.670 --> 21:32.600
So it's going to detect him after the wall hit anyway.

21:33.410 --> 21:36.950
Okay, I guess we need to create another boolean just to fix this bug.

21:36.980 --> 21:40.190
Let's do private bool can charge.

21:46.070 --> 21:47.810
Going to be true by default.

21:47.810 --> 21:52.580
Then over here we're going to do and can charge.

21:52.700 --> 21:55.220
Then we can do can move true.

21:55.820 --> 22:06.170
And let's set up can charge to false and then can charge will be true only when it's good I noticed.

22:06.170 --> 22:08.360
And we're going to go to the next video.

22:14.540 --> 22:17.570
Oh he still does it huh.

22:18.320 --> 22:20.540
Maybe we can do a different approach here.

22:20.810 --> 22:26.000
Uh, let's not use this boolean, but let's use is grounded.

22:26.480 --> 22:29.750
If player detected and is grounded and only then.

22:34.220 --> 22:35.900
Supposed to help.

22:37.010 --> 22:38.150
Just an idea.

22:38.180 --> 22:43.940
Let me remove this in charge and in charge.

22:44.570 --> 22:44.870
Oh.

22:47.510 --> 22:48.350
Because he detected me.

22:48.350 --> 22:50.090
If he is bouncing, which is not cool.

22:50.120 --> 22:51.440
Okay, now it's fixed.

22:51.470 --> 22:52.010
All right.

22:52.010 --> 22:53.270
I'm happy about it.

22:54.680 --> 23:00.380
Q yeah, I like it so much, man.

23:05.750 --> 23:06.410
Whoa!

23:06.920 --> 23:07.820
Oh my God.

23:14.720 --> 23:15.500
It's so good.

23:15.530 --> 23:16.250
Okay.

23:16.250 --> 23:18.830
Thank you so much for paying attention.

23:18.830 --> 23:23.630
Let's not forget to remove this over here and I'll see you in the next video.
