WEBVTT

00:00.080 --> 00:02.320
Let's move our player game object.

00:02.320 --> 00:06.160
We just want this player game object to move in the right direction.

00:06.160 --> 00:08.360
So we're gonna create a script for that.

00:08.360 --> 00:13.920
So what you basically need to do you need to select the player game object in which game object you

00:13.920 --> 00:14.480
want to do.

00:14.480 --> 00:16.040
So in our case player.

00:16.040 --> 00:18.960
So we're going to select our player GameObject in the hierarchy.

00:19.080 --> 00:21.320
Then go over to Inspector in the right.

00:21.320 --> 00:24.360
And then click on this add component over here.

00:24.680 --> 00:27.320
And in the bottom you can see New script.

00:27.320 --> 00:32.880
So just click there, name the script or whatever you want, something like player movement or player.

00:32.880 --> 00:37.760
And after doing that click on this create and add or else what else you can do.

00:37.800 --> 00:42.320
You can head over to this project tab, then assets and then create a script folder.

00:42.320 --> 00:48.360
First something like right click first, then create folder and name that folder to something like scripts,

00:48.600 --> 00:51.760
and then move over to that scripts folder.

00:51.760 --> 00:56.240
Then right click or then create in the top, then monobehaviour script.

00:56.360 --> 01:03.400
Or you can just scroll down a bit which is say which says scripting and choose this Monobehaviour script.

01:03.440 --> 01:10.480
Not anything, not others, because we're going to attach this script to our game object.

01:10.480 --> 01:12.880
So as you can see, I already have created.

01:12.880 --> 01:16.800
So what I'm going to do, I'm going to select my player GameObject in the hierarchy.

01:16.800 --> 01:23.600
And let's select that script and drag it over to this Add Component section in the inspector or or you

01:23.600 --> 01:25.000
can just simply do this.

01:25.240 --> 01:30.280
Click on this add component and you can find the script by typing name of the script.

01:30.280 --> 01:31.840
So in my case player.

01:32.160 --> 01:37.040
So as soon as I type you can see the script just gets pop up.

01:37.040 --> 01:41.760
So I'm not going to attach it twice because I already have attached as you can see.

01:41.760 --> 01:43.600
So I'm going to open up our script.

01:43.600 --> 01:49.400
So let's double click on this player script over here to open that up in Visual Studio.

01:49.400 --> 01:53.520
So by default as you can see we have start and update function.

01:53.520 --> 01:55.280
And it's called class player.

01:55.600 --> 01:57.360
Basically class is a template.

01:57.360 --> 02:02.480
We're gonna use this template in order to move this player game object.

02:02.480 --> 02:03.760
So you can think of it.

02:03.760 --> 02:08.640
This this is the design and we're gonna implement in this player game object.

02:08.640 --> 02:12.880
Let's suppose we just want to move this player game object to the right direction.

02:12.880 --> 02:19.520
So we can define those attributes in order to move this player game object in the right direction.

02:19.520 --> 02:20.560
So this is the class.

02:20.560 --> 02:24.840
And we're going to use this class in order to move our player game object.

02:24.840 --> 02:28.480
So this is the thing and we have start function over here.

02:28.760 --> 02:31.680
So void basically means function or method.

02:31.680 --> 02:34.800
You can simply say and this is start function.

02:34.800 --> 02:37.360
And start function gets called when the game start.

02:37.360 --> 02:41.680
And this update function over here is just called again and again and again.

02:41.680 --> 02:43.520
So let's suppose you want to check.

02:43.680 --> 02:46.440
So we just want to see a message in the console.

02:46.640 --> 02:49.840
So if this function correctly working or not.

02:49.840 --> 02:53.080
So let's go to start function in between these curly brackets.

02:53.120 --> 02:54.640
Whatever you gonna write.

02:54.640 --> 02:57.640
It will be executed in the start of the game.

02:57.640 --> 02:57.920
Why?

02:57.960 --> 03:02.910
Because this start function get call in the start of the game and it just call one time.

03:02.910 --> 03:05.790
And let's suppose you just want to see a message.

03:05.790 --> 03:11.470
And in order to see a message or just want to print out a message, what you need to do, you need to

03:11.510 --> 03:12.750
type this debug.

03:12.790 --> 03:18.070
And then you need to use this dot log function and make first bracket and quotation.

03:18.070 --> 03:19.790
You need to type this quotation.

03:19.790 --> 03:26.190
And in between this quotation you can put whatever message you just want to see in console tab.

03:26.190 --> 03:29.830
So let's suppose something like we're going to say this is start function.

03:29.830 --> 03:34.150
So I'm going to say this is start start function.

03:34.150 --> 03:37.430
You can just put whatever you just want to print out.

03:37.830 --> 03:39.190
It's totally up to you.

03:39.190 --> 03:42.390
And make sure you also close that up with semicolon.

03:42.390 --> 03:48.110
So this debug dot log function it's going to print out the message you want to print out or want to

03:48.110 --> 03:48.470
see.

03:48.590 --> 03:53.030
And you make sure you just type in quotation because you need to pass a string.

03:53.230 --> 03:56.470
And in string you have to put this quotation.

03:56.470 --> 03:58.310
So make sure you just do that.

03:58.310 --> 04:00.750
And let's, uh, we need to save our script.

04:00.750 --> 04:02.110
So how we can save that?

04:02.110 --> 04:07.310
We can simply press down Ctrl s in order to save our script or what else you can do.

04:07.350 --> 04:12.910
You can just go over to this top left file and then click on this save over here.

04:12.910 --> 04:15.790
And the shortcut key you can see Ctrl plus S.

04:15.910 --> 04:19.910
So we're going to press Ctrl plus S in order to save our script.

04:19.910 --> 04:21.870
And now let's move over to unity.

04:21.870 --> 04:25.190
And in unity just gonna take a moment to compile our script.

04:25.190 --> 04:27.990
Basically whatever we have done, it's gonna save.

04:28.190 --> 04:31.630
And once it's done we are ready to go.

04:31.830 --> 04:36.910
So we just type this function and make sure you just put at the end a semicolon.

04:36.910 --> 04:41.550
So basically that means this line of code just gains or gets end over here.

04:41.550 --> 04:42.910
So that is the thing.

04:43.470 --> 04:48.390
And uh make sure you just do inside this curly brackets.

04:48.390 --> 04:50.630
And now let's move over to unity.

04:50.830 --> 04:55.870
And we're going to select our console tab in order to print out our want to see the message.

04:55.870 --> 05:00.350
If you are not able to find the console tab, then you can go to window in the top.

05:00.390 --> 05:04.790
Then scroll down to general and you can find the console tab and the shortcut key.

05:04.830 --> 05:08.510
You can see in the right section which is Ctrl Shift plus C.

05:08.790 --> 05:14.030
So I already have the console tab, so I'm not going to bring up that one once again.

05:14.030 --> 05:20.390
So let's click on this play button in the top in order to play our game or in order to start our game.

05:20.390 --> 05:22.630
And you will see in the start of the game.

05:22.630 --> 05:26.430
So whenever the game just gonna start that message just gonna pop up.

05:26.630 --> 05:32.670
So as you can see, as soon as the game started, we can see a message in the console says this is a

05:32.670 --> 05:35.430
start function, why this thing gets pop up.

05:35.430 --> 05:41.150
Because as you can see, we have done inside this start function and a start function get called in

05:41.150 --> 05:42.310
the start of the game.

05:42.310 --> 05:47.950
So what we're doing inside this start function we just printing out a message in the console says this

05:47.950 --> 05:50.310
is start function as you can see.

05:50.310 --> 05:56.110
So that's why as soon as the game started that message just gets pop up in the console says this is

05:56.110 --> 05:56.990
star function.

05:56.990 --> 06:00.910
So let's click on this play button in the top in order to get out of play mode.

06:00.910 --> 06:04.590
And let's, uh, talk about the update function by now.

06:04.750 --> 06:10.790
And we can simply just double click on this message in the console in order to move that line of code.

06:10.790 --> 06:14.910
So we can just double click on it in order to move that line of code.

06:14.910 --> 06:16.590
So we're going to remove this message.

06:16.590 --> 06:19.230
And now we're going to test with this update function.

06:19.230 --> 06:20.230
So we're going to check.

06:20.230 --> 06:23.430
We just want to print out message this update function.

06:23.430 --> 06:29.070
So this update function get called every single time in one second something like 60 times.

06:29.070 --> 06:32.470
But it's going to depend what computer you're using.

06:32.470 --> 06:39.590
If you're using superfast computer then or system then this update function in one second it's gonna

06:39.590 --> 06:41.310
run 120 frames.

06:41.310 --> 06:42.430
So it's gonna depend.

06:42.430 --> 06:46.790
So let's print out a message if it's perfect, perfectly working or not.

06:46.910 --> 06:52.670
And in order to print out message we're going to type debug dot log and make first bracket and then

06:52.670 --> 06:53.430
quotation.

06:53.430 --> 06:57.540
Make sure you just type this quotation and you can put whatever message.

06:57.540 --> 07:06.020
You just want to say something like, I'm going to say this is update of date function, and let's close

07:06.020 --> 07:10.500
that off with semicolon Ctrl S to save your script and then move over to unity.

07:10.860 --> 07:14.700
So unity is just going to take a moment to compile our script.

07:14.700 --> 07:21.380
And once it's done, we can just click on this play button in the top in order to play our game or in

07:21.380 --> 07:22.780
order to start our game.

07:22.780 --> 07:23.700
So just wait.

07:25.020 --> 07:27.820
And now let's click on this play button in the top.

07:27.820 --> 07:29.260
You will see that.

07:35.100 --> 07:36.260
So just wait.

07:36.900 --> 07:42.900
So as you can see, as soon as the game started we can see a message in the console.

07:42.900 --> 07:46.660
This is update function just printing out over again and again.

07:46.660 --> 07:50.380
And we can see the count over here in this console tab in the top right.

07:50.500 --> 07:51.860
Top right you can see.

07:51.860 --> 07:56.940
So it's already called over a hundred times, as you can see.

07:56.980 --> 08:02.500
And the message just getting pop up every single time, because that update function runs every single

08:02.540 --> 08:03.900
time in one second.

08:04.140 --> 08:12.540
Uh, something like, uh, uh, you can simply say, uh, 60 frames or if you using a, a pretty fast

08:12.540 --> 08:18.020
system or heavy system, then it's gonna run in one second, something like 120 frames.

08:18.020 --> 08:23.660
So let's get out of play mode instead of printing out message what we want, we want this player game

08:23.700 --> 08:26.140
object to move in the right direction.

08:26.140 --> 08:27.380
So we need to move that.

08:27.380 --> 08:33.500
So if we select our player game object in a hierarchy then move over to Inspector Transform and play

08:33.500 --> 08:34.980
around with x axis.

08:35.020 --> 08:37.900
We can see we just moving left and right.

08:37.900 --> 08:42.340
So we just want this player game object to move in the right direction.

08:42.340 --> 08:46.660
So let's double click on this message in order to move that line of code.

08:46.660 --> 08:51.540
And instead of printing out message we're gonna move our player game object.

08:51.540 --> 08:53.900
So we're gonna do inside this update function.

08:53.900 --> 08:54.260
Why?

08:54.300 --> 08:59.940
Because if update function runs every single frame and every single frame, we need to move this player

08:59.980 --> 09:02.060
game object to the right direction.

09:02.060 --> 09:06.980
So we're not going to do this start function because a start function just gonna call in the start of

09:06.980 --> 09:09.260
the game and it's gonna call one time.

09:09.260 --> 09:13.020
So we will stop at some point moving to the right side.

09:13.020 --> 09:18.140
So that's why we're going to do inside this update function because we need to move our player game

09:18.180 --> 09:20.940
object every single frame to the right direction.

09:20.940 --> 09:24.260
So what we're going to do now we're going to type this transform.

09:24.260 --> 09:27.380
And then we're going to use dot translate function.

09:27.380 --> 09:30.940
So use this translate function and then make first bracket.

09:30.940 --> 09:36.740
So this transform translate function it's going to take the direction in which direction you just want

09:36.780 --> 09:37.260
to move.

09:37.260 --> 09:40.940
So what we have done we just type transform basically what we're doing.

09:40.940 --> 09:41.740
We just moving.

09:41.740 --> 09:47.020
If we select our player game object in the hierarchy, we're just moving over to this transform component

09:47.020 --> 09:48.540
of this player game object.

09:48.540 --> 09:51.780
So if we move to inspector we have transform component.

09:51.780 --> 09:53.740
So we're just moving over you.

09:53.780 --> 09:55.620
We're using this transform.

09:55.620 --> 09:59.300
So this transform right over here basically means this transform.

09:59.300 --> 10:04.460
And we're using this translate function in order to move and this translate function, it's going to

10:04.460 --> 10:09.660
take the direction in which direction you just want to move your player game object.

10:09.660 --> 10:12.980
So we want this player game object to the move right side.

10:12.980 --> 10:16.060
So what we're going to do we're going to move over to this line of code.

10:16.060 --> 10:18.340
And we're going to use a vector two.

10:18.380 --> 10:21.860
Because that vector two has x axis and y axis.

10:21.860 --> 10:25.260
So we don't want this player game object to move in the y axis.

10:25.260 --> 10:28.020
So we're going to put in the y axis something like zero.

10:28.140 --> 10:33.860
And we want this player game object to move in the right side basically means x axis.

10:33.860 --> 10:35.260
So this is x axis.

10:35.260 --> 10:37.620
So we can select the move tool from here.

10:37.900 --> 10:43.140
So we use we're gonna use vector two because vector two has two axis.

10:43.140 --> 10:44.420
And we want this.

10:44.900 --> 10:48.380
We want this player game object to move in the right side.

10:48.380 --> 10:52.370
So we're gonna use the x axis instead of the y axis.

10:52.370 --> 10:53.930
So we're going to do this thing.

10:53.930 --> 10:56.290
So let's go to that line of code.

10:56.330 --> 10:57.650
And we're going to use new.

10:57.650 --> 11:03.570
So make sure users typing as I did over here which is new vector two and then make first bracket.

11:03.610 --> 11:07.370
So this vector two has x axis and y axis.

11:07.370 --> 11:11.970
So what we want we want to move this player game object horizontally.

11:11.970 --> 11:15.170
Or you can simply say in the x axis something like this.

11:15.370 --> 11:19.450
And we don't want this player game object to move in the y axis.

11:19.450 --> 11:22.450
So that's why in the y axis we're going to put zero.

11:22.450 --> 11:26.570
So 0FF basically over here referencing float numbers.

11:26.690 --> 11:35.170
Float numbers basically those number which comes with decimal places like 1.5, 1.2, 1.9, or also

11:35.210 --> 11:38.970
whole numbers like zero, one, two, three, four is a float number.

11:39.450 --> 11:44.730
So make sure you just put F at the end a it's basically referencing float.

11:44.970 --> 11:49.410
And in the x axis we want to move this player game object to the right side.

11:49.410 --> 11:52.770
So that's why in the x axis we're going to put one f.

11:52.770 --> 11:54.050
So let's go to script.

11:54.050 --> 11:55.570
And we're going to put one f.

11:55.690 --> 11:58.650
And then make sure you just close that up with semicolon.

11:58.650 --> 12:01.530
And we're going to press down Ctrl S to save our code.

12:01.570 --> 12:03.410
Now let's move over to unity.

12:03.610 --> 12:09.610
So we will see this player GameObject will move to the right direction every single time one unit.

12:09.610 --> 12:12.970
And it's gonna not move at all in the y axis.

12:13.010 --> 12:13.330
Why?

12:13.370 --> 12:18.290
Because in the y axis, as you can see, we put zero f and in the x one.

12:18.290 --> 12:23.810
So every single frame this player GameObject will seem like it's just going in the right direction with

12:23.850 --> 12:26.290
one unit every single frame.

12:26.290 --> 12:28.650
So let's click on this play button in the top.

12:28.650 --> 12:33.970
You will see that as soon as the game starts gonna start, you will see this player GameObject just

12:33.970 --> 12:35.890
gonna move to the right direction.

12:35.890 --> 12:37.570
So let's have a look on this.

12:37.570 --> 12:43.090
So as you can see, as soon as the game started, the player GameObject just moved too much fast.

12:43.090 --> 12:48.170
So what we have to do, let's get out of play mode and let's move over to that line of code.

12:48.170 --> 12:52.370
So what we need, we need to multiply these things with time dot delta time.

12:52.370 --> 12:56.090
So as you see in our player game, object moved too fast.

12:56.090 --> 13:01.570
So that's why we need to multiply this whole thing, this vector two or in which direction we moving.

13:01.690 --> 13:04.290
We need to multiply with time.deltatime.

13:04.290 --> 13:05.290
Why we.

13:05.330 --> 13:07.770
Because we need to make frame rate constant.

13:07.770 --> 13:12.410
So let's suppose you using a a super fast computer.

13:12.410 --> 13:19.610
So in your case the, the uh this update function over here, it's gonna run in one second 120 frames.

13:19.650 --> 13:22.410
Uh, but I do have a little bit slow system.

13:22.410 --> 13:27.370
So in my case, this update function in one second it's gonna run 60 frames.

13:27.370 --> 13:32.730
So you can see there is a huge difference between our frame rate.

13:32.730 --> 13:38.050
So that's why to make it constant, we need to multiply these things with this, uh, direction with

13:38.050 --> 13:39.330
time.deltatime.

13:40.730 --> 13:46.050
So we're gonna use this star symbol, sorry, this symbol in order to multiplication.

13:46.050 --> 13:48.690
And we need to multiply with time.deltatime.

13:48.730 --> 13:52.410
Basically, that is a frame rate of change in frame rate.

13:52.410 --> 13:55.170
So I'm going to multiply with time dot delta time.

13:55.170 --> 13:57.570
And make sure you just close that up with semicolon.

13:57.570 --> 13:59.290
And let's move over to unity.

13:59.610 --> 14:07.250
So we will see we will able to see that uh so our player game object now just going to move to the right

14:07.250 --> 14:09.330
direction with too much slowly.

14:09.730 --> 14:11.010
Uh let me show you.

14:11.010 --> 14:15.930
So let's click on this play button in the top to play our game.

14:15.930 --> 14:17.970
And let's have a look on this.

14:24.970 --> 14:30.650
As soon as the game started, as you can see, our player game object just moving to the right direction.

14:30.650 --> 14:34.970
But the problem is is that our speed is too much slow.

14:34.970 --> 14:38.730
So let's get out of play mode and we're gonna stretch this ground first.

14:38.730 --> 14:44.290
So let's select the ground GameObject in the hierarchy, and let's uh, select the right tool from here

14:44.290 --> 14:45.250
in this scene view.

14:45.410 --> 14:49.480
And then we're gonna move this in the Something x axis.

14:50.200 --> 14:52.320
And I guess this is fine.

14:52.320 --> 14:54.000
And let's go to that line of code.

14:54.000 --> 14:59.960
So we're going to multiply this whole thing with some uh numbers, something like uh numbers.

15:00.000 --> 15:01.280
Uh, something like five.

15:01.520 --> 15:05.560
So our, our player game object just gonna move a little bit faster.

15:05.760 --> 15:11.320
So let's go to that line of code and let's multiply this whole thing, uh, this whole thing, uh,

15:11.320 --> 15:11.920
some units.

15:11.920 --> 15:16.880
So we're gonna multiply with something like five F to make our speed a little bit fast.

15:16.880 --> 15:21.680
So we're moving to the right direction with one unit, and we multiply it with five f.

15:21.800 --> 15:23.800
So this will be five f in the.

15:23.800 --> 15:25.320
So one into five f.

15:25.360 --> 15:31.160
Just gonna be five f means this player game object will move in the right direction every single frame

15:31.160 --> 15:33.120
with five units of speed.

15:33.120 --> 15:38.600
So our player game object is just gonna seem it's gonna move to the right direction with a little bit

15:38.640 --> 15:39.640
more fast.

15:39.680 --> 15:44.520
So let's go to, uh, script and let's press down Ctrl s to save our script.

15:44.520 --> 15:46.920
And now let's move over to unity.

15:46.920 --> 15:52.560
So we will see this player GameObject just gonna move to the right direction with five unit of speed.

15:52.720 --> 15:55.000
So let's have a look on this.

15:56.920 --> 16:00.800
And let's click on this play button in the top to play our game.

16:00.800 --> 16:02.280
And we're gonna see that.

16:02.680 --> 16:07.560
So as soon as the game gonna start you will see this player GameObject just going to move to the right

16:07.560 --> 16:09.760
direction with five unit of speed.

16:09.800 --> 16:17.120
As you can see, our player GameObject is now moving with little bit fast means five F with a right

16:17.160 --> 16:17.880
direction.

16:17.880 --> 16:19.320
So let's get out of play mode.

16:19.400 --> 16:23.000
But it would be nice if we able to control our speed.

16:23.000 --> 16:27.120
So if we select our player game object then go over to Inspector in the right.

16:27.160 --> 16:30.920
We just want to see a variable right underneath our player.

16:30.920 --> 16:36.080
Skip basically a speed that we can define in this player game object.

16:36.080 --> 16:39.120
So we just want to adjust over here the speed.

16:39.160 --> 16:45.200
And we don't need to move over to this, uh, this line of code and just change this number in order

16:45.200 --> 16:46.920
to match up a correct speed.

16:46.920 --> 16:48.480
So I'm going to make a variable.

16:48.480 --> 16:50.640
So we will go to top of our class.

16:50.640 --> 16:53.240
And we're going to declare a variable variable.

16:53.240 --> 16:56.800
You can simply say a container where we can put values.

16:56.800 --> 17:01.440
And we can use that container or the value in order to make something.

17:01.440 --> 17:02.760
So we're going to make it public.

17:02.760 --> 17:04.480
So why are we making it public.

17:04.480 --> 17:10.440
So we can see underneath our player skip right over here and the inspector so we can adjust it over

17:10.440 --> 17:10.760
here.

17:10.760 --> 17:13.040
So that's why we just made it public.

17:13.280 --> 17:19.120
And the variable type just going to be float basically means decimal numbers, which comes with decimal.

17:19.280 --> 17:21.840
And numbers like 1.2, 1.5.

17:21.880 --> 17:25.560
Even whole numbers zero, one, two, three, four is a float number.

17:25.560 --> 17:28.120
So the type of variable is going to be float.

17:28.120 --> 17:31.760
And we have to name the variable or the container what we want to name it.

17:31.760 --> 17:33.760
So I'm going to call it something like speed.

17:33.960 --> 17:37.680
And you can just set equal to a default value.

17:37.720 --> 17:41.120
Or you can simply close that off with semicolon as well.

17:41.120 --> 17:46.320
But if you just want to give a default value you can set equal to and the number.

17:46.320 --> 17:48.360
You just want to set a default value.

17:48.360 --> 17:50.320
So I'm going to say something like five if.

17:50.440 --> 17:54.600
And let's close that off with semicolon to end this line of code over here.

17:54.600 --> 17:56.280
And now we're going to move over to this.

17:56.280 --> 17:59.200
And we're going to replace this five with this speed.

17:59.240 --> 18:00.320
So we're going to replace.

18:00.320 --> 18:01.640
So the speed is five.

18:01.640 --> 18:03.080
So this is going to be five.

18:03.080 --> 18:06.240
So five into one just going to be five.

18:06.240 --> 18:09.720
So we will move to the right direction with five unit of speed.

18:09.720 --> 18:16.120
But we do know that we just made it public so we can adjust the number or the variable underneath our

18:16.120 --> 18:18.760
player script in Unity in Inspector.

18:18.760 --> 18:20.680
So we're going to save our script.

18:20.680 --> 18:23.480
Let's press down Ctrl S to save our script.

18:23.480 --> 18:25.320
And let's move over to unity.

18:25.920 --> 18:31.560
So we can we're gonna be able to see that field just going to appear underneath our player script.

18:31.600 --> 18:31.960
Why?

18:32.000 --> 18:33.320
Because we made it public.

18:33.320 --> 18:37.720
So that's why the variable is just going to pop up underneath our player's game.

18:37.720 --> 18:44.960
So as you can see, as soon as our player script just gets compiled we are able to see our speed parameter.

18:44.990 --> 18:46.710
and by default we set five.

18:46.750 --> 18:47.990
As you can see.

18:47.990 --> 18:53.310
So if you don't set equal to something like that and you just close that off with semicolon.

18:53.310 --> 18:55.670
So this by default is going to be zero.

18:56.110 --> 18:58.590
But we can adjust it over here as well.

18:58.590 --> 19:00.670
We can set it to something like seven.

19:00.670 --> 19:02.750
So this is just going to be seven.

19:02.750 --> 19:06.070
So seven into one just going to be as as seven.

19:06.070 --> 19:09.790
So we will move to the right direction with seven unit of speed.

19:09.790 --> 19:17.590
But I'm gonna make I'm gonna make this number a little bit lower, something like uh 4.2, something

19:17.590 --> 19:18.390
like that.

19:18.550 --> 19:23.430
And now what we're going to do, if we click on this play button in the top, we will see this player

19:23.430 --> 19:27.590
game object is going to move with this much speed in the right direction.

19:27.630 --> 19:31.910
Because we set speed parameter to 4.2 as you can see.

19:31.910 --> 19:34.310
So we're going to move uh with that much speed.

19:34.310 --> 19:40.910
And we can just mess around with this value in order to make our player, uh, speed, uh, slow.

19:41.030 --> 19:46.710
And we can see player is going to the right direction because we set the speed parameter to negative

19:46.710 --> 19:50.030
value and we can set it to positive value as well.

19:50.030 --> 19:54.310
So we can play with our while in play mode with this variable.

19:54.310 --> 19:56.110
So this is pretty much cool thing.

19:56.350 --> 19:59.870
And make sure you just auto play mode because it's not gonna save.

19:59.870 --> 20:05.230
So if you just click on this play button and change something in play mode, it's not going to be safe.

20:05.230 --> 20:09.670
So make sure you just click on this play button in the top in order to get out of play mode.

20:09.670 --> 20:16.230
And then copy that number and you can just paste that number that you, uh, that you just could, uh,

20:16.830 --> 20:22.510
that you, uh, as you made a good number while in play mode.

20:22.910 --> 20:28.590
And what we do have to do now, we need to, uh, we need to move over to this inspector.

20:28.590 --> 20:33.150
So make sure you select the player game object in the hierarchy first, then go over to Inspector,

20:33.190 --> 20:36.030
then overrides, and then click on Apply All.

20:36.030 --> 20:41.870
So the changes we made over here in Inspector of this player game object, it will be saved into this

20:41.870 --> 20:44.230
player GameObject prefab as well.
