1
00:00:03,350 --> 00:00:07,340
In his lecture, we're going to lay out a simple level that we can drive our car around and give a little

2
00:00:07,340 --> 00:00:09,770
bit of meaning to our game world.

3
00:00:09,860 --> 00:00:13,600
First of all, when I click on play, I'm still driving around my capsule.

4
00:00:13,610 --> 00:00:14,360
We don't want that.

5
00:00:14,360 --> 00:00:15,470
Let us do a change.

6
00:00:15,470 --> 00:00:16,940
So we drive around our car.

7
00:00:16,970 --> 00:00:18,140
Now, this is really simple.

8
00:00:18,140 --> 00:00:22,370
If you click on Cruising Drive, you'll see that under Sprite Renderer we have the Sprite.

9
00:00:22,370 --> 00:00:26,470
So saying, What visual representation do you want of this particular game object?

10
00:00:26,480 --> 00:00:30,350
If you click on the little target, select the thing next to where it says Capsule.

11
00:00:30,380 --> 00:00:33,770
Then you'll see that we've got all of the sprites that we've just brought into our game.

12
00:00:33,770 --> 00:00:37,790
If you don't see them, you could always type in the search box for car and then you'll see them listed

13
00:00:37,790 --> 00:00:38,140
out here.

14
00:00:38,150 --> 00:00:39,220
CAR One, two, three.

15
00:00:39,230 --> 00:00:42,110
So I want you to select one of these cars, either one or two or three.

16
00:00:42,110 --> 00:00:43,160
I'm going to use car three.

17
00:00:43,310 --> 00:00:44,150
I quite like it.

18
00:00:44,150 --> 00:00:45,110
Double click on that.

19
00:00:45,110 --> 00:00:50,600
And now when I click on play, I should be driving around but but above driving around a car.

20
00:00:50,630 --> 00:00:51,100
Cool.

21
00:00:51,110 --> 00:00:54,680
One thing you'll notice though is as I drive over here, if I get close to this thing that I should

22
00:00:54,680 --> 00:00:59,000
be bouncing into, it's like, Oh, I don't bounce into it until I've practically over the top of it,

23
00:00:59,270 --> 00:01:01,550
till my wheels smacking into it.

24
00:01:01,550 --> 00:01:03,860
And so let's have a look at why that's happening.

25
00:01:03,860 --> 00:01:07,850
If I move my car a little bit down here, it's going to click on my other car and just delete that.

26
00:01:07,850 --> 00:01:11,570
That was just an image hanging out or is this is my game object that's driving?

27
00:01:11,570 --> 00:01:16,010
If I turn off the Sprite renderer on and off, you can see that we've got our box collider is too small.

28
00:01:16,010 --> 00:01:16,940
So what can we do for that?

29
00:01:16,940 --> 00:01:22,850
Well, scroll in a bit so I can see if you find the box collider and just while I'm here we say this

30
00:01:22,850 --> 00:01:26,480
capsule collider I'm going to right click and remove component to delete that.

31
00:01:26,480 --> 00:01:28,640
I thought I did that before, but maybe I didn't.

32
00:01:28,640 --> 00:01:29,540
So we have our box.

33
00:01:29,540 --> 00:01:31,370
Collider If you see where it says Edit.

34
00:01:31,370 --> 00:01:33,320
Collider Click on the little button there.

35
00:01:33,320 --> 00:01:39,680
Now we've got some handles, these green dots down the end of our box here and you can move them so

36
00:01:39,680 --> 00:01:42,950
that your collision box fits exactly where you want it to fit.

37
00:01:42,950 --> 00:01:49,000
So I'm going to put mine just slightly within the frame of my vehicle here and then down to the end.

38
00:01:49,010 --> 00:01:49,400
There we go.

39
00:01:49,400 --> 00:01:54,230
Now, our collision should allow us to bump into things more cleanly when we're driving around.

40
00:01:54,230 --> 00:01:55,880
So drive, drive, drive, bulk.

41
00:01:55,880 --> 00:01:56,300
Okay.

42
00:01:56,360 --> 00:02:01,400
The other thing I'm going to do while I'm here just super quickly is click on the main camera and give

43
00:02:01,400 --> 00:02:03,740
ourselves a little bit more view because we're a bit too close, aren't we?

44
00:02:03,740 --> 00:02:05,150
It's a bit hard to see what's going on now.

45
00:02:05,150 --> 00:02:08,330
Well, just here to close the car so we see it under camera.

46
00:02:08,330 --> 00:02:09,410
It says size.

47
00:02:09,410 --> 00:02:15,050
That allows us to change the size or in other words, change how close we look like we are to our world.

48
00:02:15,050 --> 00:02:17,870
So go ahead and make that whatever setting you want.

49
00:02:18,320 --> 00:02:23,430
You don't need to do the same as mine, but I'll probably make mine about 12 I think looks pretty good.

50
00:02:23,450 --> 00:02:28,190
Next, what we want to do is organize our hierarchy a little bit so we don't just have a big old mess

51
00:02:28,190 --> 00:02:29,780
of stuff that we've popped in there.

52
00:02:29,790 --> 00:02:32,150
The way we do this is with empty game objects.

53
00:02:32,150 --> 00:02:37,580
So if you right click in your hierarchy, click Create Empty and you'll see it says Game Object Highlighted.

54
00:02:37,580 --> 00:02:40,670
I'm going to type in here World Objects.

55
00:02:40,700 --> 00:02:44,590
You can call it whatever you want world objects or environment or trees or what have you.

56
00:02:44,600 --> 00:02:49,310
Now it's good practice to come over to the transform on this empty game object.

57
00:02:49,310 --> 00:02:51,050
It's an empty game object because there's nothing there.

58
00:02:51,050 --> 00:02:54,230
There's no component has a transform because everything has a transform.

59
00:02:54,230 --> 00:02:55,760
But there's nothing else to say what it is.

60
00:02:55,760 --> 00:02:57,170
It's just an empty thing.

61
00:02:57,170 --> 00:03:01,130
It's a container that allows us to do grouping and categorization, which is cool.

62
00:03:01,130 --> 00:03:07,070
So I'm going to right click on Transform and just click on Reset that will reset it back to 000.

63
00:03:07,070 --> 00:03:10,730
Just so I know that this empty game object is right in the middle of the world.

64
00:03:10,730 --> 00:03:11,510
Just one of those things.

65
00:03:11,510 --> 00:03:15,380
It doesn't matter a lot just yet, but it's a good practice because there'll be things in the future

66
00:03:15,380 --> 00:03:18,980
where you want to know that it's 000 for all of these aspects.

67
00:03:18,980 --> 00:03:23,240
Now I'm going to highlight all of my things that I've randomly dropped in there the houses and the rocks

68
00:03:23,240 --> 00:03:24,260
and the trees and stuff.

69
00:03:24,260 --> 00:03:29,240
And I'm going to after highlighted them so shift and then click from one point shift and then click.

70
00:03:29,240 --> 00:03:34,310
I'm going to hold down left mouse button and drag all of those on top of world objects, not below where

71
00:03:34,310 --> 00:03:37,010
you see the blue line or above just right on top bunk.

72
00:03:37,010 --> 00:03:40,940
And that means that these are now childhood underneath world objects.

73
00:03:40,940 --> 00:03:43,640
The world object is the parent and all these things are the children.

74
00:03:43,640 --> 00:03:47,390
And for now, all we need to know is that means I can just roll that up and I don't have to see all

75
00:03:47,390 --> 00:03:49,010
that noise in my hierarchy.

76
00:03:49,010 --> 00:03:55,430
It also means if I click on World Objects, for example, that will grab everything below that as well.

77
00:03:55,430 --> 00:04:00,740
And I can move everything around at the same time that's within that particular grouping of game objects

78
00:04:00,740 --> 00:04:03,740
or as we would say, children underneath the parent.

79
00:04:03,740 --> 00:04:05,900
Okay, while we're here, I've got three houses.

80
00:04:05,900 --> 00:04:10,270
I'm going to click on each of these three houses, so a click and then hold shift and then click again.

81
00:04:10,300 --> 00:04:13,460
You can see it highlighted them in the world and highlighted in our hierarchy.

82
00:04:13,460 --> 00:04:17,779
And then I'm going to come over and add component box collider to DH, make sure you got the two D down

83
00:04:17,779 --> 00:04:22,760
the end and you'll see that puts a box or a collision around the outside of these houses.

84
00:04:22,760 --> 00:04:27,470
So if I try to drive through them Smash, I can't, I just bounce straight into them, which is cool.

85
00:04:27,470 --> 00:04:28,190
That's what we want.

86
00:04:28,190 --> 00:04:32,180
But we want to do the same for anything you add into the world that needs some sort of collision.

87
00:04:32,210 --> 00:04:38,150
These trees we probably put around a circle to DH Collider, I think, rather than putting a box collider.

88
00:04:38,150 --> 00:04:41,660
But we'll get to those in a moment after we've laid out our level and we've got stuff in there.

89
00:04:41,660 --> 00:04:43,640
So I just wanted to show you that step at this point.

90
00:04:43,640 --> 00:04:46,490
Now, what I want to do is to lay out a really basic level.

91
00:04:46,490 --> 00:04:52,130
So to drop down some road, make some bends and some what have you, put some trees and houses, just

92
00:04:52,130 --> 00:04:53,270
something really simple.

93
00:04:53,270 --> 00:04:58,190
You can go crazy on this after we've finished working through the project, but for now we don't want

94
00:04:58,190 --> 00:05:00,830
to over engineer this and spend too, too much time on it.

95
00:05:00,830 --> 00:05:02,720
You could if you wanted things to snap now.

96
00:05:02,800 --> 00:05:03,270
Nice and neatly.

97
00:05:03,370 --> 00:05:07,750
You can click, make sure you click on Global and then click on the snapping mechanism next to it.

98
00:05:07,750 --> 00:05:12,070
So it's highlighted and that means that when you move around things, they'll go click, click, click,

99
00:05:12,070 --> 00:05:14,500
click and snap to each unity unit.

100
00:05:14,500 --> 00:05:19,360
You can see over here it's going from -14, 15, 16, 17, and so on.

101
00:05:19,360 --> 00:05:23,020
I'm going to turn that off and just be fast and loose and just sort of slap things down and not worry

102
00:05:23,020 --> 00:05:23,350
so much.

103
00:05:23,350 --> 00:05:27,760
If I've got little gaps in my roads, I'm not going to worry about precision yet because who knows?

104
00:05:27,760 --> 00:05:30,550
Once we made our game, we might want to have a totally different layout.

105
00:05:30,550 --> 00:05:34,840
So the challenge I've got for you now is make a simple neighborhood that your delivery driver can drive

106
00:05:34,840 --> 00:05:35,440
around in.

107
00:05:35,440 --> 00:05:39,010
And as you do this, don't worry about if it doesn't fit within your game window.

108
00:05:39,040 --> 00:05:43,240
We're going to do something with the camera in upcoming lectures to make the camera follow the player.

109
00:05:43,240 --> 00:05:48,250
So take up as much space as you want when you do that, but don't over engineer it because we will potentially

110
00:05:48,250 --> 00:05:49,870
be changing things as we go.

111
00:05:49,870 --> 00:05:52,540
And then please do share a screenshot of what you come up with.

112
00:05:52,540 --> 00:05:55,090
So there you go, pause a video, take on that challenge.

113
00:05:55,090 --> 00:05:56,410
See you back here when you're done.

114
00:05:58,860 --> 00:05:59,060
Okay.

115
00:05:59,100 --> 00:06:00,660
I'm going to go through this really quickly.

116
00:06:00,660 --> 00:06:02,820
I'm going to rotate my first road piece.

117
00:06:02,820 --> 00:06:04,020
Actually, I'm going to delete that one.

118
00:06:04,020 --> 00:06:04,770
That's not the right one.

119
00:06:04,770 --> 00:06:07,800
I'm going to get one of these big roads, drop that into the scene.

120
00:06:07,800 --> 00:06:11,340
And I'm just going to speed up the video now here so you can see what I'm doing.

121
00:06:11,340 --> 00:06:14,520
I'm starting out by getting a general feel of where I want things to be placed.

122
00:06:14,520 --> 00:06:19,530
Just move the houses around a bit, a little bit, a lot of control d to duplicate things like houses.

123
00:06:19,530 --> 00:06:20,820
Just make another one, make another one.

124
00:06:20,820 --> 00:06:23,940
I've dropped in some rowdy kind of road pieces and I'm like, You know what?

125
00:06:23,940 --> 00:06:26,130
A roundabout would make sense in the middle here.

126
00:06:26,130 --> 00:06:27,750
So I pop that down, adding some trees.

127
00:06:27,750 --> 00:06:32,670
I tried a square bit of road, but it didn't quite scale, so I popped in another roundabout in there

128
00:06:32,670 --> 00:06:34,140
just to get the symmetry going.

129
00:06:34,170 --> 00:06:38,880
A few more houses, a couple of trees, just a little bit of set dressing there to pop them around.

130
00:06:38,880 --> 00:06:42,360
It's good to scale, rotate, make them look a little bit different so it doesn't look like you've just

131
00:06:42,360 --> 00:06:44,370
dropped the same thing down over and over.

132
00:06:44,370 --> 00:06:50,180
And just to get it a bit more interesting than just the roads, okay, now let's do a little test run

133
00:06:50,180 --> 00:06:51,570
and make sure I can drive around my world.

134
00:06:51,600 --> 00:06:54,270
Bump into things, bump, conclusion on that.

135
00:06:54,270 --> 00:06:55,620
Bump, drive, drive.

136
00:06:55,620 --> 00:06:56,130
Cool.

137
00:06:56,130 --> 00:06:58,590
Okay, so obviously we can't see our whole level.

138
00:06:58,590 --> 00:07:00,810
I can see it over in my scene view.

139
00:07:00,810 --> 00:07:02,970
If I wanted to watch where my car is going, that's cool.

140
00:07:02,970 --> 00:07:05,130
We need to get our camera to follow our player around.

141
00:07:05,160 --> 00:07:06,660
There's a little basic level we can use.

142
00:07:06,660 --> 00:07:07,020
You know what?

143
00:07:07,050 --> 00:07:08,700
One last thing that's bugging me at the moment.

144
00:07:08,700 --> 00:07:12,480
I don't like that the background is blue, so I'm going to find my camera, click on main camera.

145
00:07:12,480 --> 00:07:15,660
I change the background color to be a grass kind of color.

146
00:07:15,660 --> 00:07:18,120
So you're driving around, there's grass in the background.

147
00:07:18,120 --> 00:07:20,940
It's not amazing, but it's a little bit better than the blue, I think.

148
00:07:20,940 --> 00:07:25,890
And then we go, I've set myself up a basic little level we can use for the remainder of our project.

149
00:07:25,890 --> 00:07:28,680
Okay, hopefully you've done a great job on yours as well.

150
00:07:28,680 --> 00:07:29,520
I'd love to see it.

151
00:07:29,520 --> 00:07:32,490
So please do share a screenshot and I'll see you in the next lecture.

