WEBVTT

00:00.020 --> 00:00.500
Hello guys.

00:00.500 --> 00:01.430
Welcome to the video.

00:01.430 --> 00:03.830
In this one I want to make another trap.

00:03.830 --> 00:08.000
Not so much of a trap, more like a movement mechanic, but still.

00:08.000 --> 00:09.650
It's very cool one I think.

00:10.310 --> 00:12.140
Let me switch off the trampoline.

00:12.890 --> 00:17.840
And let's go to asset Graphics traps arrow.

00:17.840 --> 00:24.470
And this is the, uh, thing that I want to make this arrow, you need to select both of them, make

00:24.470 --> 00:26.270
pixel per unit 16.

00:26.270 --> 00:30.410
And then let's take one of them and put it into the scene certain layer.

00:31.020 --> 00:34.770
Trump and let's rename it to Trap Arrow.

00:35.370 --> 00:40.500
It's not so much of a trap, more like a, you know, movement mechanic, but nevertheless it's very

00:40.500 --> 00:43.290
cool one and it's going to be extremely easy to make.

00:43.380 --> 00:46.500
First of all, let's set up animation for this one.

00:46.500 --> 00:49.530
And then I'm going to show you what we need to do to make it look even better.

00:49.530 --> 00:50.130
Okay.

00:50.430 --> 00:53.460
And let's go to animations traps.

00:53.460 --> 00:56.670
Over here I want to make folder for controllers.

00:59.160 --> 01:00.150
Nice.

01:00.210 --> 01:01.680
Now we're going to take these two.

01:01.680 --> 01:05.280
Drag them here and make another controller inside.

01:06.090 --> 01:08.850
Uh, trap arrow AC.

01:09.480 --> 01:11.490
Let's put it on the object.

01:13.400 --> 01:16.700
Also, we need a circle collider.

01:16.730 --> 01:18.950
We're going to make it as is.

01:18.950 --> 01:19.760
Trigger.

01:20.520 --> 01:24.270
And let's go to animator and make two animations.

01:25.450 --> 01:27.640
Gonna go to traps make.

01:30.960 --> 01:33.300
This was from my trial.

01:33.300 --> 01:37.230
Okay, so it's going to be arrow, uh, idle.

01:38.660 --> 01:39.680
Let's save it.

01:39.680 --> 01:40.100
Actually.

01:40.100 --> 01:40.670
Let's do.

01:40.700 --> 01:41.510
Trap.

01:41.510 --> 01:42.080
Arrow.

01:42.080 --> 01:42.830
Idol.

01:45.670 --> 01:46.060
All right.

01:46.060 --> 01:49.510
We're going to go to Graphics Traps arrow.

01:49.510 --> 01:51.250
And let's take this sprites.

01:51.700 --> 01:52.660
Put them here.

01:52.660 --> 01:54.610
Sample rate 20.

01:55.840 --> 01:58.690
Then we need one more trap.

01:58.690 --> 02:01.180
Arrow activated.

02:02.490 --> 02:07.050
You're going to take these and put them here with a sample rate 20.

02:07.260 --> 02:08.040
Nice.

02:08.070 --> 02:09.750
Now let's make a trigger.

02:11.860 --> 02:12.250
Uh.

02:12.250 --> 02:13.180
Activate.

02:14.450 --> 02:19.790
And we're going to transfer to this animation with a trigger over here.

02:19.790 --> 02:22.730
Exit I'm uncheck transition duration zero.

02:22.730 --> 02:23.900
That's good for now.

02:24.170 --> 02:30.890
Now let's go over here I think it should be a bit bigger because it's kind of small now.

02:30.890 --> 02:32.240
Barely can see it.

02:32.240 --> 02:35.600
So I'm going to make it as 1.5 over here.

02:35.690 --> 02:36.530
Very cool.

02:36.530 --> 02:37.760
This is a bit better.

02:38.180 --> 02:43.400
Now this object will push player and in the same way as a trampoline does.

02:43.400 --> 02:50.270
But also I'm going to rotate the object with the time like so, and because of that, player will have

02:50.270 --> 02:56.270
to catch the right moment and only jump on the arrow when it points to the direction where he needs

02:56.270 --> 02:56.780
to go.

02:56.780 --> 02:59.000
Okay, that's going to be the idea of it.

02:59.000 --> 03:05.150
And also I want to destroy the arrow once it is used, and then I want to create a new arrow after some

03:05.150 --> 03:07.190
amount of time, like with a cooldown.

03:07.700 --> 03:07.970
Yeah.

03:07.970 --> 03:10.460
So first let's make jumping mechanic for this one.

03:10.460 --> 03:13.820
And actually it's going to be very easy to do if we use inheritance.

03:13.820 --> 03:16.700
This is a good example of how we can use inheritance.

03:16.700 --> 03:18.920
And this is going to be just a brief explanation.

03:18.920 --> 03:23.360
I'm going to explain some things, but not too much because we're going to discuss inheritance more

03:23.360 --> 03:26.480
later on in the enemies section there.

03:26.480 --> 03:30.950
I'm going to pay lots of attention to the inheritance, but we also need to use it now.

03:30.950 --> 03:35.780
So I'm going to give you a quick example how it can be used and just, you know, just in case, I'm

03:35.780 --> 03:40.580
going to say that if you don't quite understand how inheritance work after this video, just wait for

03:40.580 --> 03:41.690
the enemies section.

03:41.690 --> 03:42.950
We're going to discuss it more.

03:42.950 --> 03:43.460
Okay.

03:43.460 --> 03:49.130
So we can go to scripts and we can make new C sharp script trap.

03:49.700 --> 03:50.270
Arrow.

03:53.110 --> 04:00.460
Trap arrow over here instead of Monobehaviour, we can type trap trampoline.

04:00.460 --> 04:07.690
And now this will mean that trap arrow inheriting properties and methods from a trap trampoline over

04:07.690 --> 04:08.290
here.

04:08.290 --> 04:09.370
This is what it does.

04:09.370 --> 04:13.180
Basically, it's like this object over here.

04:13.180 --> 04:16.540
Trap trampoline has a script of a trap trampoline.

04:16.540 --> 04:19.630
But Trap Arrow is inheriting.

04:19.630 --> 04:21.310
Let's put it on the object.

04:21.310 --> 04:23.290
We can see it has same variables.

04:23.290 --> 04:25.480
It is inheriting from a trap trampoline.

04:25.480 --> 04:29.350
And because of that, it sort of has two scripts in its possession.

04:29.350 --> 04:35.170
You know, this one has all the functionality that trap trampoline has over here.

04:36.650 --> 04:39.440
And because of that, we do need to do anything else here.

04:39.440 --> 04:44.000
We can just go to unity, give it push power of 25.

04:45.480 --> 04:47.970
And when I enter the trigger area.

04:51.200 --> 04:53.540
It's going to push me up just like that.

04:54.200 --> 04:58.130
Because it inherits the functionality from a trap trampoline.

04:58.160 --> 04:59.420
This is how it is.

05:01.710 --> 05:03.420
There is something that you should know.

05:03.450 --> 05:10.110
As of now, these methods are available to Trap arrow, but only because these methods are part of Monobehaviour

05:10.110 --> 05:11.850
like awake for example.

05:11.850 --> 05:18.300
Also on trigger, enter is triggered when something enters the trigger collider.

05:18.300 --> 05:25.320
But because these variables are private, as you can see and methods are private as well, we cannot

05:25.320 --> 05:26.880
adjust these variables.

05:26.880 --> 05:30.240
We cannot do anything with them on a trap arrow over here.

05:30.240 --> 05:36.180
As a example, if I type here awake, it's going to make a new method that has nothing in common with

05:36.180 --> 05:37.980
this awake over here.

05:37.980 --> 05:44.700
And also, even though we have anim and this trap arrow inherits from a trampoline, we cannot use anim

05:44.700 --> 05:45.660
here as well.

05:45.660 --> 05:47.190
We cannot use push force.

05:47.190 --> 05:54.750
If we want to use this variables, we need to make them as protected because private means these are

05:54.750 --> 05:56.730
available only to this class.

05:56.730 --> 05:58.680
But if we make them protected.

05:59.510 --> 06:06.710
Now it will be available to this class and to the class that inherits from, uh, trap trampoline.

06:06.710 --> 06:10.280
And now I can use any movie here, but still it is not public.

06:10.280 --> 06:12.470
So public is available to everyone.

06:12.470 --> 06:16.520
Private is available only to the class and protected is available to the class.

06:16.520 --> 06:19.460
And those classes that are inheriting from a main class.

06:19.460 --> 06:20.330
Simple as that.

06:20.330 --> 06:25.940
We do need to override any functionality from a trap trampoline for now, so I'm going to keep it as

06:25.940 --> 06:26.570
it is.

06:26.570 --> 06:32.180
Let's just leave it at that and let's go and make rotation for the arrow.

06:32.210 --> 06:34.010
It's going to be not that difficult to do.

06:34.040 --> 06:37.970
We want to have some sort of, uh, serialized field.

06:37.970 --> 06:44.720
Let's make a header, header, arrow or maybe additional additional info just like that.

06:44.720 --> 06:45.470
It's fine.

06:45.470 --> 06:48.680
I'm going to do private float rotation speed.

06:48.680 --> 06:53.120
Let's make it equals to 120 by default.

06:53.120 --> 06:57.620
And let's make serialized field private bool rotating.

06:57.620 --> 06:58.430
Right.

06:58.760 --> 07:02.270
Because we want to decide if we rotate arrow to the right or to the left.

07:03.020 --> 07:06.410
Um, then we need to open update method.

07:06.410 --> 07:12.260
And over here we're going to type transform rotate zero on the x zero on the y.

07:12.260 --> 07:14.960
We want to rotate only around z axis.

07:14.960 --> 07:19.940
If you go to unity uh select Rotation Tool and rotate the object.

07:22.270 --> 07:24.430
Over here, you'll see that Z changes.

07:24.430 --> 07:26.860
So we need to change the Z.

07:28.180 --> 07:29.080
Rotation.

07:30.070 --> 07:31.450
Let's go back here.

07:31.450 --> 07:33.910
I'm going to use a rotation speed.

07:33.910 --> 07:38.140
Multiply it by time dot delta time because I want it to be frame rate independent.

07:38.140 --> 07:38.860
Nice.

07:38.860 --> 07:42.250
Now let's go back and see this in the action.

07:44.430 --> 07:45.750
I'm going to go to play mode.

07:47.170 --> 07:48.760
We can see it's rotating.

07:49.490 --> 07:52.970
And I need to guess the right time to jump into the arrow.

07:54.390 --> 08:00.990
Because it always will push player to the up axis, and because object is rotating, this axis is always

08:00.990 --> 08:01.950
changing itself.

08:01.950 --> 08:05.070
For example, if I jump now, I'm going to be pushed back.

08:05.870 --> 08:06.800
Okay.

08:06.950 --> 08:07.970
Very cool.

08:10.140 --> 08:12.900
Let's go and make use of this boolean over here.

08:13.080 --> 08:16.650
I feel a bit lazy so I'm going to do this if rotating right.

08:18.610 --> 08:21.520
Then rotate with a minus speed.

08:21.880 --> 08:24.010
Else transform.

08:24.520 --> 08:26.560
Or actually, maybe we can do.

08:26.890 --> 08:27.220
Yeah.

08:27.220 --> 08:28.450
Let's be smart here.

08:28.450 --> 08:33.160
Private int direction equals to minus one by default.

08:33.610 --> 08:36.100
And then over here I'm going to do direction.

08:36.940 --> 08:39.010
Equals to rotating rate.

08:40.310 --> 08:43.310
Then use one, else use minus one.

08:43.310 --> 08:45.860
I hope I'm right because I might be wrong here.

08:46.720 --> 08:49.930
And then we're going to rotate with a rotation.

08:50.950 --> 08:54.970
Multiplied by direction, multiplied by direction.

08:54.970 --> 08:59.830
Let's put it into parentheses and multiply that with a time Delta time.

08:59.830 --> 09:00.400
Yeah.

09:01.240 --> 09:01.990
A bit cleaner.

09:01.990 --> 09:02.620
Very good.

09:02.620 --> 09:06.220
And also I want to destroy the arrow once it is activated.

09:06.220 --> 09:09.880
So I'm going to make Private Void destroy me.

09:09.880 --> 09:11.770
And it's going to just destroy the object.

09:11.980 --> 09:15.820
And let's do destroy GameObject just like that.

09:15.820 --> 09:17.500
Let's save this.

09:17.500 --> 09:19.300
Let's go back to unity.

09:21.650 --> 09:29.060
Over here on the animation of activated after the last frame over here I want to place.

09:30.060 --> 09:30.600
Trap.

09:30.600 --> 09:31.680
Arrow methods.

09:31.680 --> 09:32.700
Destroy me.

09:33.330 --> 09:33.990
Good.

09:33.990 --> 09:36.330
Now let's go and see the rotation.

09:37.460 --> 09:41.450
So now it says, okay, we need to do an opposite.

09:42.900 --> 09:43.230
Yeah.

09:43.230 --> 09:43.740
I'm sorry.

09:43.740 --> 09:46.080
Let's quickly change it before I forget.

09:46.590 --> 09:49.500
This should be minus one and one.

09:49.950 --> 09:50.550
Okay.

09:51.850 --> 09:52.390
Yeah.

09:52.390 --> 09:53.740
Uh, let's go now.

09:59.450 --> 10:01.220
And we can see it's rotating to the left.

10:01.220 --> 10:04.460
If I click the boolean, it is rotating to the right.

10:04.490 --> 10:09.140
Now I'm going to jump into an arrow and it was destroyed very well.

10:09.140 --> 10:11.210
Now we need to create a new arrow.

10:11.210 --> 10:15.950
Once this one being used, uh, we need to make a prefab of the arrow.

10:15.950 --> 10:17.840
So I'm going to just drag it here.

10:17.840 --> 10:24.320
And we could make functionality of an arrow creation in the arrow itself and somehow disable it and

10:24.320 --> 10:25.010
then enable it.

10:25.010 --> 10:29.720
But I don't really want to make object that will create itself, because then it will create clone of

10:29.720 --> 10:31.970
a clone, and then clone of a clone of a clone.

10:31.970 --> 10:34.130
And it's going to be like that endlessly.

10:34.130 --> 10:37.370
So I think I have no better choice for now.

10:37.370 --> 10:38.780
So I'm going to use Game Manager.

10:38.780 --> 10:41.300
Maybe later on we're going to have another object, another manager.

10:41.300 --> 10:42.320
We can use that.

10:42.320 --> 10:44.480
But for now I'm just going to use game manager.

10:44.480 --> 10:45.920
I'm going to make a header.

10:47.200 --> 10:48.100
Or traps.

10:48.100 --> 10:52.810
And I'm going to make public GameObject arrow prefab.

10:52.810 --> 10:56.260
Yeah just that and let's should we make a cool down here.

10:56.260 --> 11:00.970
Now I'm going to do cool down on a trap arrow, because we might want to set up cooldown of the arrows

11:00.970 --> 11:02.770
differently for different levels.

11:02.770 --> 11:08.980
So I'm going to just do prefab and let's go ahead all the way down here.

11:08.980 --> 11:11.710
And I'm going to make a method that will start a coroutine.

11:11.710 --> 11:17.350
So first I need private Ienumerator create object coroutine.

11:18.540 --> 11:19.650
In this quarantine.

11:19.650 --> 11:24.810
We want to pass game object because this can be used later on, not only for the arrow, but for something

11:24.810 --> 11:25.230
else.

11:25.230 --> 11:29.610
Like we don't know what is going to happen in the future, but it would be nice to set up things and

11:29.610 --> 11:30.630
be ready in the future.

11:30.630 --> 11:35.250
So game object prefab and we need float delay.

11:35.250 --> 11:37.200
We want to create object with a delay.

11:37.200 --> 11:40.170
Then I'm going to do yield return new.

11:40.170 --> 11:42.990
Wait for a seconds of delay.

11:43.530 --> 11:46.050
This should be delay.

11:46.050 --> 11:48.540
And then game object.

11:48.630 --> 11:51.630
New object equals to instantiate.

11:52.710 --> 11:53.610
Um, prefab.

11:53.610 --> 11:54.990
I guess we need position.

11:54.990 --> 11:56.100
Something that I forgot.

11:56.100 --> 12:01.050
So I'm going to do vector three position just like that.

12:01.050 --> 12:03.960
Now let's pass transform here.

12:03.960 --> 12:06.030
Transform target.

12:06.030 --> 12:13.110
And over here I'm going to make a vector three new position equals to target dot position.

12:13.110 --> 12:13.560
Yeah.

12:13.590 --> 12:17.010
Because otherwise we might destroy the object with the transform.

12:17.010 --> 12:18.870
And we would not be able to use it.

12:18.870 --> 12:22.410
That's why we store in transform in a vector three position.

12:22.410 --> 12:27.300
Over here we're going to use new position and quaternion identity for the rotation.

12:27.300 --> 12:28.230
Very nice.

12:28.230 --> 12:32.250
Now let's make a public method that will call this coroutine public void.

12:32.340 --> 12:35.160
Um create object.

12:35.190 --> 12:37.710
We're going to pass GameObject prefab.

12:37.710 --> 12:44.220
Then we're going to use uh transform target and Float Delay.

12:44.220 --> 12:46.680
And I want to give it a default value of zero.

12:46.680 --> 12:50.040
So if you don't pass any delay it's going to have no delay.

12:50.040 --> 12:52.080
If you pass some value it's going to have delay.

12:52.080 --> 12:58.470
Now here we're going to do start coroutine of create object coroutine with a prefab target and delay

12:58.470 --> 12:59.130
okay.

12:59.130 --> 13:00.000
Nothing new.

13:00.000 --> 13:03.360
We did all of this before just you know in different combination.

13:03.360 --> 13:07.080
Let's save this and then let's go to Trap Arrow.

13:08.270 --> 13:10.010
Open curly brackets here.

13:11.820 --> 13:19.560
And before we destroy the object, let's go ahead and make a reference to the arrow prefab.

13:20.280 --> 13:23.310
And I'm going to pull it from a game manager dot instance.

13:23.340 --> 13:24.480
Arrow prefab.

13:24.480 --> 13:30.450
Of course, I could make method specifically for the arrow on a game manager, but I want this method

13:30.450 --> 13:31.380
to be versatile.

13:31.380 --> 13:33.510
That's why I'm just passing game object here.

13:33.510 --> 13:38.100
And if I need arrow, I'm just pulling it from a game manager here.

13:38.130 --> 13:38.670
Okay.

13:39.870 --> 13:41.160
So that's what I'm doing.

13:41.160 --> 13:45.720
And then game manager dot instance create object of arrow prefab.

13:45.720 --> 13:47.970
We're going to pass transform of existing arrow.

13:47.970 --> 13:50.820
So it will replace itself with a new arrow.

13:51.240 --> 13:57.990
And for the cooldown let's make a variable serialize field private float cooldown.

13:57.990 --> 14:00.090
And we're going to pass it over here.

14:00.090 --> 14:01.050
Cooldown.

14:01.700 --> 14:02.510
All right.

14:02.510 --> 14:04.370
There is something else I want to do to improve it.

14:04.370 --> 14:08.120
But later on, let's just go ahead and try this for now.

14:08.510 --> 14:09.770
We're going to save it.

14:09.770 --> 14:11.570
Save everything actually.

14:11.570 --> 14:13.220
And let's go back to unity.

14:16.100 --> 14:17.180
On a game manager.

14:17.180 --> 14:22.400
We want to load the prefabs, and on the game manager we're going to assign this trap arrow.

14:23.370 --> 14:25.290
Then trap arrow over here.

14:25.290 --> 14:26.370
Let's do rotating rate.

14:26.370 --> 14:28.320
And let's say cooldown is 0.5.

14:28.320 --> 14:29.880
I just want to be sure it's working.

14:29.880 --> 14:32.790
So I'm going to create new arrows a lot.

14:34.370 --> 14:36.440
It's rotating and I'm going to go there.

14:38.140 --> 14:38.410
Ah!

14:38.410 --> 14:39.280
What is it?

14:40.100 --> 14:42.890
The object of type unity engine transform has been destroyed.

14:42.890 --> 14:44.930
But you still trying to access it?

14:46.300 --> 14:51.460
And this is what I was talking about, that we might destroy the transform and we're still trying to

14:51.460 --> 14:52.060
use it.

14:52.060 --> 14:52.570
Okay.

14:52.570 --> 14:57.970
Over here, we just need to move this line of code above so it will save vector three immediately before

14:57.970 --> 15:00.400
the delay, and then it's going to use it later on.

15:00.400 --> 15:01.180
Yes.

15:01.180 --> 15:02.440
Let's go now.

15:07.940 --> 15:13.280
Have the arrow going to jump into the arrow and it's going to create new arrow again.

15:13.280 --> 15:14.570
Very nice.

15:20.910 --> 15:24.480
Let's put higher cooldown on a prefab over here.

15:25.520 --> 15:26.000
Uh.

15:26.000 --> 15:26.930
It's zero.

15:26.930 --> 15:29.630
Let's do one and let's try.

15:33.270 --> 15:34.830
Yeah, okay.

15:35.580 --> 15:36.360
Very cool.

15:36.360 --> 15:37.320
It's working.

15:41.280 --> 15:42.000
I like it.

15:42.030 --> 15:45.120
Now there is something else I want to do to improve the arrow.

15:45.270 --> 15:52.920
And let's do a cooldown of 1.5 and let's do overwrite apply all so it will be applied to this arrow

15:52.920 --> 15:53.790
over here.

15:53.790 --> 15:59.670
I want to do something else here I want to gradually increase the scale of the arrow when it appears.

15:59.670 --> 16:04.080
So it's going to appear very small just like this.

16:04.080 --> 16:08.730
And then it's going to grow to the size it should have, and it's going to look real nice like it's

16:08.730 --> 16:09.600
popping out.

16:10.050 --> 16:12.600
Uh, for that we're going to use lerp.

16:12.600 --> 16:15.360
And you might never use lerp before.

16:15.360 --> 16:19.650
I'm going to explain briefly, but if you want to know more about lerp, I'm going to attach a video

16:19.650 --> 16:21.210
about lerp that I have.

16:21.210 --> 16:22.200
It's really a nice one.

16:22.200 --> 16:24.090
So if you want to know more, just check the video.

16:24.450 --> 16:31.080
Let's add a space over here and then let's type serialize field private float grow speed.

16:31.080 --> 16:33.450
And I'm going to make it equals to ten by default.

16:33.810 --> 16:40.320
And then also I want to have serialized field private vector three target scale okay.

16:40.320 --> 16:48.300
And then at the start we're going to do transform local scale equals to new vector three.

16:48.300 --> 16:52.110
And with this we changing scale of the transform.

16:52.660 --> 16:57.430
With a new vector that's going to be 0.3 f, 0.3 f, 0.3 f.

16:57.550 --> 17:03.340
Then in the update, let's take these two lines of code and rub them into a method.

17:03.580 --> 17:05.530
Handle rotation.

17:06.260 --> 17:11.000
Yeah, this one probably better be scale up speed.

17:11.030 --> 17:11.480
Yeah.

17:11.480 --> 17:12.140
Better.

17:13.480 --> 17:20.680
Now in the update, we cannot check entire vector like entire scale, but we can use scale X for example,

17:20.680 --> 17:23.140
and then use it to decide what we need to do next.

17:23.140 --> 17:31.300
So I'm going to do if transform local scale dot x is less than target scale, dot x means we need to

17:31.300 --> 17:36.280
scale up the object, and if we need to scale up the object, we're going to do transform local scale

17:36.280 --> 17:42.880
equals to Vector3 dot lerp and lerp is quite confusing in the beginning, but it's very easy to use.

17:43.420 --> 17:46.300
Uh, when you use an lerp, it's going to give you a value.

17:46.300 --> 17:51.340
You can usually say what you want to lerp, like you want to lerp from position A to position B.

17:51.340 --> 17:56.950
In our case, we want to lerp from a transform local scale that we have to the target scale.

17:58.340 --> 17:59.720
That we want to have.

18:00.530 --> 18:07.190
And then you need to decide, like the step you want to have sort of the percentage of the value you

18:07.190 --> 18:07.970
want to have.

18:07.970 --> 18:16.040
If you want to move from point A to point B and size of your step will be 30%, then you just set 0.3

18:16.040 --> 18:17.150
F, for example.

18:17.150 --> 18:21.170
Yeah, lerp always takes um, the percentage of value.

18:21.620 --> 18:22.610
Uh, look at this.

18:24.000 --> 18:29.010
Let's say I need to increase value gradually from 1 to 10.

18:29.800 --> 18:33.190
And size of the step will be 0.5.

18:33.220 --> 18:38.650
Okay, so the first time it's going to take half and it's going to be.

18:39.810 --> 18:41.430
Are removed.

18:41.460 --> 18:44.910
The next time I'm using lerp is going to take half again.

18:45.760 --> 18:50.140
The next time I'm using lerp is going to take half again because step size is 0.5.

18:50.820 --> 18:55.380
And like that huff huff huff huff.

18:55.380 --> 18:59.010
Because of that, it's going to look smooth, slow and nice.

18:59.340 --> 19:04.740
So over here I'm going to use scale up speed multiplied by time dot delta time.

19:06.420 --> 19:07.110
Okay.

19:07.730 --> 19:09.950
Very cool, I love it.

19:10.160 --> 19:12.290
Let's take these two lines of code.

19:12.290 --> 19:14.600
The extract method.

19:15.400 --> 19:17.440
Handle scale up.

19:18.770 --> 19:19.850
Just like that.

19:20.290 --> 19:22.810
Then we're going to go to the unity.

19:25.960 --> 19:32.020
Let's find prefab and make target scale 1.51.51.5.

19:33.280 --> 19:37.030
Now let's go destroy the arrow and see how it's going to.

19:37.060 --> 19:38.320
Yeah, that is very nice.

19:38.320 --> 19:39.310
You can see that.

19:40.970 --> 19:44.840
I'm going to you and it's growing like that.

19:44.840 --> 19:46.490
Really smooth and nice.

19:46.610 --> 19:48.740
Lerp can be used for many things.

19:49.880 --> 19:52.010
This is just one of the examples.

19:55.640 --> 19:57.320
Yeah, like how it turns out.

19:57.320 --> 19:58.640
Really cool mechanic.

19:59.800 --> 20:00.490
Need to wait.

20:00.490 --> 20:02.200
And then I need to bounce there.

20:02.200 --> 20:03.100
Yeah.

20:03.250 --> 20:04.300
All right.

20:04.420 --> 20:05.500
That's good for now.

20:05.500 --> 20:09.010
Let's save this and let's go to the next video.
