WEBVTT

00:00.120 --> 00:03.040
As you can see, I have created multiple crowns.

00:03.040 --> 00:09.480
So if I move over to my project tab, then assets and then prefabs, I just created multiple and we

00:09.480 --> 00:13.760
can just double click on it in order to open it up in prefab mode.

00:13.760 --> 00:17.920
So I'm going to double click on this something like this Crown underscore nine.

00:17.960 --> 00:22.640
As you can see, as soon as we open it up we can see our crown.

00:22.960 --> 00:24.640
So I have done the same thing.

00:24.640 --> 00:31.400
I just make this box collider as the size of this crown, and we just assign it this ground or this

00:31.400 --> 00:35.400
parent game object as a box tag, as you can see in Inspector.

00:35.400 --> 00:41.240
So if I select this crown underscore nine GameObject in the hierarchy, then move over to Inspector.

00:41.280 --> 00:42.320
You can see tag.

00:42.320 --> 00:44.760
We just tag it as a box tag.

00:44.760 --> 00:49.240
So make sure you just tag it with something else as we have done already.

00:49.680 --> 00:50.760
So we're going to go back.

00:50.760 --> 00:53.360
So in hierarchy you're going to see a back arrow.

00:53.360 --> 00:58.520
So just click there in order to move over to scene view or just to go back.

00:58.800 --> 01:02.980
And so what we're going to do now we're going to create a script in order to spawn.

01:02.980 --> 01:08.540
So I'm going to delete I'm going to delete this ground underscore nine sorry ground underscore one game

01:08.580 --> 01:11.980
object or this ground underscore one I'm going to delete.

01:12.020 --> 01:14.700
And I'm going to drag it something else something.

01:15.020 --> 01:18.020
Or you can say uh other ground.

01:18.020 --> 01:21.900
So I'm going to select my ground underscore one GameObject in the hierarchy.

01:21.900 --> 01:23.340
And I'm going to delete that.

01:23.340 --> 01:27.900
And I'm going to select a perfect ground for from the starting of the game.

01:27.900 --> 01:30.220
So that's why I'm going to select this one.

01:30.220 --> 01:32.460
So this one is ground underscore six.

01:32.460 --> 01:36.860
So I'm going to select that drag it over to this hierarchy or into this scene view.

01:36.860 --> 01:44.660
So I'm going to drag it on to on top of this ground underscore C sorry uh on in this hierarchy.

01:44.820 --> 01:49.540
And we are ready to uh, you can simply say we are ready to spawn.

01:49.540 --> 01:52.140
But before we do, let's have a look on this.

01:52.140 --> 01:56.460
So I'm going to click on this play button in the top in order to play our game.

01:57.540 --> 01:59.140
And you will see that.

01:59.140 --> 02:06.170
So we need to spawn once we just trigger it or that box, then we're going to spawn the next round from

02:06.210 --> 02:07.450
a next point.

02:08.290 --> 02:12.610
So as you can see, we are moving, but we moving too much slowly.

02:12.610 --> 02:15.650
So I'm going to make the speed a little bit faster.

02:15.650 --> 02:22.170
But before we do, let's get out of play mode and let's create a script in order to spawn the next round.

02:22.170 --> 02:23.130
So let's do that.

02:23.130 --> 02:26.170
So we're going to move over to this project tab, then assets.

02:26.170 --> 02:28.970
And then we're going to move over to this scripts folder.

02:28.970 --> 02:29.970
So right click there.

02:29.970 --> 02:33.250
Or you can simply right click on this assets as well.

02:33.250 --> 02:34.690
And then create in the top.

02:34.690 --> 02:37.010
And you're going to see Monobehaviour script.

02:37.010 --> 02:42.170
Or you can just move over to this scripting and select this Monobehaviour script because we're going

02:42.210 --> 02:44.450
to attach this script to our game object.

02:44.450 --> 02:47.850
So that's why we need to create a Monobehaviour script.

02:47.850 --> 02:50.370
So I already have created over here.

02:50.370 --> 02:54.810
As you can see I have a script called Ground Spawner.

02:54.810 --> 03:01.090
So what we need to do now, we need to attach this script to any game object or in hierarchy, or we

03:01.090 --> 03:04.990
can simply create a separate game object for this script.

03:04.990 --> 03:06.030
So let's do that.

03:06.030 --> 03:07.550
So I'm going to move over to hierarchy.

03:07.550 --> 03:11.230
Right click Hierarchy in Hierarchy or click on this plus icon.

03:11.230 --> 03:13.390
Then create an empty game object.

03:13.390 --> 03:17.110
And I'm going to name this game object to something like as the name of the script.

03:17.110 --> 03:25.990
So I'm going to name it something Crown spawner and make sure make sure you just go to transform transform

03:25.990 --> 03:28.390
in the inspector right click and reset it.

03:28.590 --> 03:33.830
And now we're going to select the script from that folder and drag it over to this Add Component section

03:33.830 --> 03:37.310
in this ground spawner game object in the Inspector.

03:37.310 --> 03:39.070
So basically you need to attach.

03:39.110 --> 03:41.590
Or you can simply click on this add component.

03:41.590 --> 03:45.870
And you can find the script by script by typing name of the script.

03:45.870 --> 03:48.030
So in our case ground spawner.

03:48.030 --> 03:50.390
So as soon as we type it's just pop up.

03:50.390 --> 03:54.230
And I'm not going to click on that in order to attach it twice.

03:54.230 --> 03:55.830
So I already have attached.

03:55.830 --> 03:58.110
So I'm not gonna do it again.

03:58.390 --> 04:01.190
So let's open up our script by double clicking on it.

04:01.550 --> 04:03.050
And what we're going to do?

04:03.090 --> 04:04.970
We're going to remove this update function.

04:04.970 --> 04:07.370
And also this comment you can say.

04:07.370 --> 04:11.090
So we're going to remove that to make our skip a clean.

04:11.090 --> 04:14.130
And we're going to make a function in order to spawn that.

04:14.130 --> 04:16.490
So we're going to make it somewhere over here.

04:16.610 --> 04:20.730
And we're going to make this function public because we're going to call this function through another

04:20.730 --> 04:21.330
class.

04:21.330 --> 04:23.850
Or you can simply say through another script.

04:23.850 --> 04:25.770
So that's why we're going to make it public.

04:25.770 --> 04:27.850
So make sure you just making it public.

04:27.850 --> 04:30.130
And for function we need to type void.

04:30.170 --> 04:32.890
And we have to name the function what we want to name it.

04:32.890 --> 04:36.650
So we're going to call it something like spawn and make spawn ground.

04:36.690 --> 04:39.130
Or we can call or we can simply call it spawn.

04:39.130 --> 04:45.370
But I'm going to call it spawn ground and then make some curly brackets and that's it.

04:45.370 --> 04:46.970
And we are ready to spawn.

04:46.970 --> 04:51.850
So what we need we need we need a reference to our ground game object.

04:51.850 --> 04:57.810
So if we move over to unity and then move over to this project app assets and then prefabs, as you

04:57.810 --> 04:59.770
can see we have many grounds.

04:59.770 --> 05:01.930
So we're going to take a random one.

05:01.930 --> 05:03.520
And then we're going to spawn it.

05:03.520 --> 05:06.640
So we need a reference of all of these a game object.

05:06.640 --> 05:09.120
Or you can simply say all of this ground.

05:09.120 --> 05:12.600
And we do know this ground itself, whole a game object.

05:12.600 --> 05:17.520
So we basically need a reference of all of these ground GameObject prefab.

05:17.520 --> 05:18.560
So let's do that.

05:18.560 --> 05:22.080
So what we're going to do now we're going to move over to top of our class.

05:22.080 --> 05:24.040
And we're going to grab the reference first.

05:24.040 --> 05:27.880
Basically we need all of this ground in order to choose a random one.

05:27.880 --> 05:30.040
And then we're going to spawn that.

05:30.040 --> 05:36.160
So let's go to top of our class and we're going to make it public a public so we can adjust through

05:36.200 --> 05:38.400
underneath our inspector.

05:38.560 --> 05:42.400
And the game object we're looking for is a ground prefab.

05:42.440 --> 05:46.000
Game object basically means all of those itself a game object.

05:46.000 --> 05:48.440
So that's why we need to type this game object.

05:48.440 --> 05:50.760
So the ground game object itself a game object.

05:50.760 --> 05:54.360
So that's why we need to type this variable type which is GameObject.

05:54.560 --> 05:56.120
And we have more than one.

05:56.120 --> 05:59.880
So if we move to unity we can see we have ground one ground two.

05:59.920 --> 06:02.800
And all of these are a little bit different.

06:02.800 --> 06:04.460
So we need all of them.

06:04.460 --> 06:08.340
And then we're going to take a random one and then we will spawn it.

06:08.340 --> 06:09.900
So we need all of them.

06:09.900 --> 06:11.940
So that's why we're going to make it array.

06:11.940 --> 06:13.980
So we need to make this square brackets.

06:13.980 --> 06:17.860
So square brackets basically just referencing it's an array array.

06:17.860 --> 06:20.860
Basically it's gonna hold up multiple things.

06:20.860 --> 06:21.940
It can be numbers.

06:21.940 --> 06:23.260
It can be game object.

06:23.260 --> 06:25.580
It can be position anything like that.

06:25.580 --> 06:27.940
So we can see we have multiple grounds.

06:27.940 --> 06:30.460
So that's why we just created a game object.

06:30.460 --> 06:35.020
And then we just made it array because we're going to put all of this ground this ground one.

06:35.020 --> 06:35.620
Round two.

06:35.660 --> 06:36.340
Round three.

06:36.380 --> 06:37.580
And and so on.

06:37.620 --> 06:41.220
We're going to take all of them and we're going to put it into this array.

06:41.340 --> 06:47.300
Or you can see this is a container which can hold multiple values or multiple ground.

06:47.300 --> 06:49.940
And we have to name the array what we want to name it.

06:49.940 --> 06:53.500
So I'm going to call it something like uh grounds.

06:53.500 --> 06:56.980
So let's call it grounds sorry grounds.

06:56.980 --> 06:59.300
And let's close that up with semicolon.

06:59.420 --> 07:06.080
And also we're going to make a index parameter in order to keep track of which is a crown we just want

07:06.080 --> 07:06.720
to spawn.

07:06.720 --> 07:09.360
So let's suppose we just want to spawn the first one.

07:10.040 --> 07:15.200
Then we're going to create a index parameter in order to keep which ground we want to spawn.

07:15.200 --> 07:17.400
So we're going to take a look on that later.

07:17.400 --> 07:22.560
So let's press down Ctrl S in order to save our script and then move over to unity.

07:22.560 --> 07:26.880
So underneath your ground spawner script you're going to see an array just going to pop up.

07:26.880 --> 07:29.880
And we just named that array is ground.

07:29.880 --> 07:33.320
So what we need to do there we need to select all of this ground.

07:33.360 --> 07:38.240
This ground underscore one ground underscore two ground underscore three and so on.

07:38.240 --> 07:39.680
We need to select all of them.

07:39.680 --> 07:43.840
And we need to put it into that array which is the ground.

07:43.840 --> 07:47.520
So let's select our ground spawner GameObject in our hierarchy.

07:47.520 --> 07:53.880
And we can see underneath our ground spawner script in Inspector a ground array just pop up and it says

07:53.880 --> 07:54.800
list is empty.

07:54.800 --> 07:57.360
Basically means this array is totally empty.

07:57.360 --> 08:01.040
So what we have to do now, we need to select this ground one by one.

08:01.040 --> 08:02.960
And we can drag it over here.

08:02.960 --> 08:08.430
But instead of doing that what you can do, you can see in Inspector A top right, a lock button.

08:08.430 --> 08:14.390
So just lock it so you can just, uh, select all of this ground and you can drag it at one time.

08:14.390 --> 08:18.230
So what we're going to do now, we're going to select all of this ground by holding down shift.

08:18.230 --> 08:19.990
Or you can simply press down.

08:20.430 --> 08:26.390
You can hold down Ctrl and you can select those ground and drag it over to this grounds array in this

08:26.390 --> 08:28.950
ground uh under ground spawner script.

08:28.950 --> 08:32.110
As you can see now we can see we have all of this ground.

08:32.110 --> 08:37.910
We have ground underscore one ground underscore two ground underscore three basically means we have

08:37.910 --> 08:38.830
all of this ground.

08:38.830 --> 08:41.510
And now we are ready to spawn them.

08:41.510 --> 08:47.270
So make also you make sure you just go to Inspector one more time and then click on this lock button

08:47.270 --> 08:50.150
in the top right to unlock the inspector.

08:50.190 --> 08:53.190
Now we just unlocked our inspector by now.

08:53.470 --> 09:00.030
So the first ground as you can see it just get defined or assign it with a some certain index so we

09:00.030 --> 09:02.030
can see the ground underscore one.

09:02.070 --> 09:07.970
Basically this ground is index is zero, and the second ground, which is the ground underscore two

09:08.170 --> 09:09.890
is index is one.

09:09.890 --> 09:12.090
As you can see it says element one.

09:12.090 --> 09:14.890
Basically it just gets defined with an index.

09:14.890 --> 09:17.730
And let's suppose we just want to spawn the fifth ground.

09:17.730 --> 09:21.650
Basically if we basically this one which is the fifth one.

09:21.650 --> 09:26.650
So if we just want to spawn we need to take a look on the index of it.

09:26.650 --> 09:31.970
So the fifth we can say ground underscore five means the fifth ground.

09:31.970 --> 09:33.770
And the index we can see is four.

09:33.770 --> 09:37.250
So we can simply pass the index in order to spawn that.

09:37.250 --> 09:41.690
So all of these are the ground just gets assigned with some certain index.

09:41.690 --> 09:47.730
And we can see underneath our ground spawner script or this underneath our grounds array.

09:47.770 --> 09:52.130
And now we are ready to uh, basically we are ready to spawn that.

09:52.130 --> 09:55.130
So let's open up our script by double clicking on it.

09:56.130 --> 09:57.930
So let's double click on that.

09:57.930 --> 10:03.290
And what we're going to do we need to we need to move over to this spawn ground function.

10:03.290 --> 10:06.190
But before we do let's create an int parameter.

10:06.190 --> 10:08.310
So let's go to the top of our class.

10:08.310 --> 10:10.990
And it doesn't need to be need to be public.

10:10.990 --> 10:12.510
Instead we're gonna make it private.

10:12.510 --> 10:17.870
So we're not gonna be able to see this parameter underneath our ground spawner script.

10:17.990 --> 10:21.870
And that will be int basically whole numbers like zero, one, two, three, four.

10:22.110 --> 10:25.150
And we're going to call it something like index prefab.

10:25.150 --> 10:31.070
Or we can simply call it prefab index or let's call it ground prefab index.

10:31.070 --> 10:33.670
Or I'm going to call it index shortly.

10:33.670 --> 10:34.910
So I'm going to call it index.

10:34.910 --> 10:37.390
And let's close that off with semicolon.

10:37.390 --> 10:39.590
So why I created this parameter.

10:39.630 --> 10:45.830
Basically this parameter over here index is just going to keep track of which uh ground we just want

10:45.870 --> 10:46.550
to spawn.

10:46.550 --> 10:50.830
So we're just gonna keep gonna keep track of the index of that ground.

10:50.830 --> 10:53.590
So let's suppose we just want to spawn the first ground.

10:53.590 --> 10:59.750
And we can see underneath our ground spawner script, the first ground index we can see zero.

10:59.750 --> 11:02.510
So that's why we just created this index parameter.

11:02.510 --> 11:07.180
In order to keep track of which ground we simply want to spawn.

11:07.180 --> 11:09.700
And now we're going to move over to this start function.

11:09.700 --> 11:13.500
And we do know that start function get call in the start of the game.

11:13.700 --> 11:15.740
But let's take a look on this later.

11:15.980 --> 11:19.620
What we're going to do now we also need a second parameter.

11:19.620 --> 11:22.540
Basically we just want to spawn our ground.

11:22.540 --> 11:26.580
And so what we need we need to spawn the next ground from this point.

11:26.580 --> 11:33.020
Or you can simply call a if we select our ground underscore six game object in my hierarchy, we can

11:33.020 --> 11:35.180
see we just created a next position.

11:35.180 --> 11:40.740
So we created this position in order to just spawn the next ground from this position.

11:40.740 --> 11:47.500
So we also need a second parameter which will be position or basically where we just want to spawn our

11:47.500 --> 11:48.340
next ground.

11:48.340 --> 11:52.420
So let's suppose we just want to spawn the next round from somewhere over here.

11:52.420 --> 11:54.460
So we also need to define the position.

11:54.460 --> 11:57.740
Then we can spawn the next ground from that position.

11:57.740 --> 12:00.340
So that's why we will go to top of our class.

12:00.340 --> 12:03.020
And we're going to make also a second parameter.

12:03.020 --> 12:04.420
And it will be position.

12:04.420 --> 12:05.580
And we're going to make it public.

12:05.580 --> 12:12.760
So we can just simply, uh, simply basically, uh, adjust it underneath our this ground spawner script

12:12.760 --> 12:20.080
so we can something over here and that will be vector to a vector to which has x axis, y axis.

12:20.080 --> 12:20.360
No.

12:20.360 --> 12:22.680
Basically it's gonna define our position.

12:22.680 --> 12:28.520
So we're gonna have this x axis basically means horizontal as well as well as the vertical which is

12:28.520 --> 12:29.920
the y axis.

12:29.920 --> 12:33.000
So that's why we just created this vector two parameter.

12:33.000 --> 12:37.320
Basically this just going to reference our uh represent our position.

12:37.320 --> 12:39.240
And we can simply call it uh.

12:39.640 --> 12:41.000
Next is spawn post.

12:41.000 --> 12:42.600
So we're going to call it next.

12:42.960 --> 12:46.800
And next spawn our spawn post.

12:46.800 --> 12:51.320
Or simply you can simply call it something like next spawn position.

12:51.320 --> 12:53.720
And we're going to close that up with semicolon.

12:53.720 --> 12:57.840
And now what we're going to do we're going to move over to this spawn ground function.

12:57.840 --> 13:02.400
And in this function what we just want to do, we just want to spawn.

13:02.400 --> 13:08.900
And in order to spawn something we need to use this instantiate function and this instantiate function.

13:08.900 --> 13:13.820
So make sure you just make these brackets and this instantiate function as a first argument.

13:13.820 --> 13:16.300
It's going to take the game object you want to spawn.

13:16.300 --> 13:22.580
So in our case we're gonna spawn this, uh, prefabs of this ground, as you can see in the unity editor.

13:22.580 --> 13:28.140
So we just want to spawn, uh, or just want to choose a random one, then we're gonna spawn that.

13:28.300 --> 13:33.820
So, uh, and we have it over here, as you can see, our top of our player, Skip.

13:33.860 --> 13:38.700
And the second thing, this instantiate function is just going to take the position from where you want

13:38.700 --> 13:39.420
to spawn.

13:39.420 --> 13:42.700
So we also have a position parameter as you can see.

13:42.700 --> 13:45.780
So we're going to spawn the next round from this position.

13:45.780 --> 13:48.140
And the third argument it's going to take the rotation.

13:48.140 --> 13:52.340
So we're not gonna rotate like that or we're not going to play with rotation.

13:52.340 --> 13:54.180
So we're gonna simply pass quaternion.

13:54.180 --> 13:56.860
Dot identity basically means no rotation.

13:57.100 --> 13:58.500
So let's pass the variable.

13:58.500 --> 14:06.700
So first thing it's going to take our uh the A you can simply say uh simply say the uh which ground

14:06.810 --> 14:10.850
you basically want to spawn or which thing you want to spawn.

14:10.850 --> 14:13.170
So in our case, we're gonna spawn ground.

14:13.170 --> 14:14.850
So we need to pass the array name.

14:14.850 --> 14:16.890
So which is in our case this ground.

14:17.050 --> 14:21.250
And then you need to make this square brackets and this square brackets.

14:21.250 --> 14:25.330
In between these square brackets you basically need to pass the index.

14:25.330 --> 14:28.090
So let's suppose we want to spawn the first ground.

14:28.090 --> 14:31.090
So basically this one if I just double click on it.

14:31.090 --> 14:32.490
So the this ground.

14:32.490 --> 14:37.850
So if you just want to spawn that that then you need to pass the index of that ground.

14:37.850 --> 14:44.330
So we can go back and we can see the index index of that ground underneath our ground spawner script.

14:44.330 --> 14:50.010
So the first ground uh underscore one game object or the first ground index we can see zero.

14:50.290 --> 14:52.850
And the second ground index is two.

14:53.490 --> 14:53.930
Sorry.

14:53.970 --> 14:56.050
The second ground index is one.

14:56.090 --> 14:58.970
As you can see I'm really apologize for that.

14:58.970 --> 15:02.730
And let's suppose you just want to spawn the seventh ground.

15:02.730 --> 15:06.050
So we can see seventh ground index is six.

15:06.050 --> 15:09.550
So we need to pass the index uh, or uh, which index?

15:09.550 --> 15:13.670
We basically want to, uh, basically want to, uh, spawn.

15:13.670 --> 15:19.230
So let's suppose I just want to spawn this ground, uh, which is the ground underscore six.

15:19.230 --> 15:21.790
So we need to see the index of that ground.

15:21.990 --> 15:26.510
And so the six ground index is five as you can see.

15:26.510 --> 15:28.870
So we can simply pass the index of it.

15:28.870 --> 15:32.310
So I'm going to pass over here five and comma.

15:32.310 --> 15:37.150
So make sure you just you need to pass the uh array first array name first.

15:37.150 --> 15:39.470
So in our case grounds as you can see.

15:39.510 --> 15:43.950
And then you need to make this square brackets in order to specify the index.

15:43.950 --> 15:48.030
So I just pass five five basically means the sixth round.

15:48.310 --> 15:50.510
And the second thing it's going to take the position.

15:50.510 --> 15:52.750
So we're going to pass this next spawn post.

15:52.750 --> 15:57.870
And we're going to define the position in the x and y somewhere something like over here.

15:57.870 --> 15:59.950
So we're going to take a look later.

16:00.270 --> 16:02.550
So for now you can simply pass the position.

16:02.550 --> 16:05.070
So we're going to pass our next spawn post.

16:05.390 --> 16:08.490
And then comma it's going to take the rotation.

16:08.490 --> 16:10.530
So we're not gonna rotate like that.

16:10.530 --> 16:15.450
So we're going to pass simply quaternion dot identity basically means no rotation.

16:15.450 --> 16:18.450
And make sure you just close that up with semicolon.

16:18.450 --> 16:21.490
So we also need to call this as spawn ground function.

16:21.490 --> 16:26.330
But when we should call it once we trigger with this uh ground.

16:26.370 --> 16:29.050
But for now let's call it in the start function.

16:29.050 --> 16:32.650
And we do know that this start function get call in the start of the game.

16:32.650 --> 16:37.850
So in the start of the game we just want to spawn our next ground from somewhere over here.

16:37.850 --> 16:43.490
So we're going to call this uh this spawn ground function in order to spawn this ground, which in our

16:43.490 --> 16:50.970
case the sixth ground and the index, uh, it, the index of it, uh, five, as you can see.

16:50.970 --> 16:56.890
So basically, we're gonna spawn the sixth ground, uh, from this position with no rotation, as you

16:56.890 --> 16:57.490
can see.

16:57.490 --> 16:59.730
So let's call it in this start function.

16:59.730 --> 17:04.530
So let's call start in start function which is spawn ground and make first bracket.

17:04.530 --> 17:06.610
And then close that up with semicolon.

17:06.610 --> 17:10.320
And we're going to press down Ctrl control is in order to save our script.

17:10.320 --> 17:12.000
And let's move over to unity.

17:12.000 --> 17:16.120
So you will see that once we start our game.

17:16.120 --> 17:21.520
So if we just click on this play button in the top in order to play our game, you will see right after

17:21.520 --> 17:28.480
the game start the that uh, the sixth round just gonna spawn uh, in the start of the game.

17:28.480 --> 17:30.600
So we're gonna spawn it something over here.

17:30.600 --> 17:33.480
So what we can simply do, we can note the position.

17:33.480 --> 17:37.160
So in order to do that I'm going to create an empty game object.

17:37.160 --> 17:39.040
So let's move over to this hierarchy.

17:39.160 --> 17:41.040
Right click or hit this plus icon.

17:41.040 --> 17:43.040
Then create an empty game object.

17:43.040 --> 17:46.400
And we're going to select the move tool from over here in this in view.

17:46.400 --> 17:49.120
And we're going to move it something over here.

17:49.120 --> 17:50.800
And we can note the position.

17:50.800 --> 17:56.000
So you can just simply select the game object first and then move over to Inspector then transform.

17:56.000 --> 17:58.200
And you can note the position in the X.

17:58.200 --> 18:04.480
So we can see in the x 55 and in the y which is uh -2.25.

18:04.480 --> 18:06.760
Or we can simply put zero as well.

18:06.760 --> 18:12.820
So it's going to be somewhere around here so we can see the position over here in the X is 55.

18:12.820 --> 18:15.020
So we're going to do 55 something like that.

18:15.020 --> 18:18.540
Or we can simply do I guess 55 point.

18:18.580 --> 18:20.580
Let's do 55.5.

18:20.980 --> 18:24.420
So 55.5in the x and in the Y zero.

18:24.420 --> 18:28.980
And we can just ignore the z axis so we can ignore that.

18:28.980 --> 18:32.820
So now what we're going to do we're going to select our ground spawner game object.

18:32.820 --> 18:40.300
And we can see underneath our ground spawner script in the Inspector index spawn just gets a pop up

18:40.300 --> 18:43.180
and it says x to zero and y to zero.

18:43.340 --> 18:46.180
So by default we just didn't set any default value.

18:46.180 --> 18:48.740
So that's why in the X it just became zero.

18:48.740 --> 18:51.020
And in the Y it just gonna be zero.

18:51.020 --> 18:53.380
So basically means this position.

18:53.380 --> 18:57.580
And we know that this position in the x is zero and the y is zero.

18:57.580 --> 19:00.380
So we don't want to spawn it from over here.

19:00.380 --> 19:03.140
And we just want to spawn that from here.

19:03.140 --> 19:09.760
So we have seen the position or we just noted the position in the X which is 55.5in.

19:09.800 --> 19:10.680
The x axis.

19:10.680 --> 19:14.800
So that's why in the x we're going to put something like 55.5.

19:14.800 --> 19:16.640
And in the Y we're going to leave it to zero.

19:16.640 --> 19:17.640
So it's going to be.

19:17.640 --> 19:19.920
So the position is just going to be over here.

19:19.920 --> 19:24.800
So the next spawn post we just define it in the X which is 55.5.

19:24.920 --> 19:27.840
And in the Y zero basically means somewhere over here.

19:27.840 --> 19:31.560
So this grounds five basically means the sixth round.

19:31.600 --> 19:33.840
Just gonna spawn next spawn post.

19:33.880 --> 19:37.640
And we just define it in the X which is 55 5.5.

19:37.640 --> 19:41.800
And in the y zero basically means the over here, something over here.

19:41.960 --> 19:45.440
And with no rotation we can see we just are spawning.

19:45.440 --> 19:48.440
So let's go to unity now and let's have a look.

19:49.440 --> 19:53.920
So the next or so basically the sixth gram should be spawn from over here.

19:53.920 --> 19:55.480
So let's have a look on that.

19:55.480 --> 19:57.000
So I'm going to click on this play button.

19:57.000 --> 20:02.600
And we do know in the start of the game we just calling that function which is spawn and spawn ground

20:02.600 --> 20:03.000
function.

20:03.000 --> 20:04.200
Just doing the best thing.

20:04.200 --> 20:09.120
It's gonna spawn that sixth gram from that position as we just passed.

20:09.120 --> 20:14.310
So as you can see, as soon as the game started, we can see this as the six.

20:14.310 --> 20:17.950
I'm going to click on this pause button in the top in order to pause my game.

20:18.110 --> 20:25.110
And we can see in our hierarchy ground underscore six clone basically means the prefab just gets spawn.

20:25.270 --> 20:27.670
And if we select that move over to Inspector.

20:27.670 --> 20:31.830
We can see in the X which is 55.5, as we said.

20:31.870 --> 20:34.350
And the y you can see is zero.

20:34.470 --> 20:36.310
So basically this position.

20:36.310 --> 20:40.430
So this six ground adjust gets spawned from this position.

20:40.430 --> 20:44.710
And you can just pass any position that you would like to go with.

20:44.910 --> 20:47.350
So I just want to spawn it from here.

20:47.350 --> 20:54.590
So that's why I just simply pass in the X which is 55.5 means from afar from our main camera.

20:54.590 --> 20:59.590
So this position in the X, which is 55.5 and in the Y zero.

20:59.590 --> 21:03.350
So that's why the six ground just gets spawn from this position.

21:03.350 --> 21:04.870
So I'm going to get out of play mode.

21:04.910 --> 21:10.790
I hope you get the idea that how you can spawn it as that, how you can spawn the next ground.
