1
00:00:03,000 --> 00:00:07,410
In this lecture, we're bringing in some assets into our game and just making sure they are all the

2
00:00:07,410 --> 00:00:10,080
right proportions in relation to one another.

3
00:00:10,080 --> 00:00:11,330
So let's get started.

4
00:00:11,340 --> 00:00:16,800
Let's start the process by bringing in the assets that I've given you so you can find those in the resources,

5
00:00:16,800 --> 00:00:21,000
which is against this lecture, either to the right of the video or down the bottom of the video, depending

6
00:00:21,000 --> 00:00:22,050
upon where you're watching this.

7
00:00:22,050 --> 00:00:25,860
And you'll see a delivery driver assets downloadable file.

8
00:00:25,860 --> 00:00:29,760
So download that and when you do, you'll see a zip file.

9
00:00:29,760 --> 00:00:32,640
What you need to do is to unzip that on windows.

10
00:00:32,640 --> 00:00:36,060
You go right click, extract all and you can unzip that on Mac.

11
00:00:36,060 --> 00:00:40,290
You can go through a similar process for unzipping that once you do that, you'll see a folder which

12
00:00:40,290 --> 00:00:43,140
has some assets in it, some nifty cars and roads.

13
00:00:43,140 --> 00:00:48,450
Now there's a really easy process when you're working with sprites like this, you can grab your folder

14
00:00:48,450 --> 00:00:53,850
and just drag it straight into your assets directory and this entire folder will be brought in.

15
00:00:53,880 --> 00:00:56,430
You can do the same one asset at a time.

16
00:00:56,430 --> 00:00:59,580
So I could click here and just bring in the car, for example, and do that one at a time.

17
00:00:59,580 --> 00:01:04,500
But bringing the whole folder, you should see that the delivery driver assets folder now exists within

18
00:01:04,500 --> 00:01:04,980
Unity.

19
00:01:04,980 --> 00:01:10,560
And interestingly, in some applications it would keep the connection to wherever you downloaded that

20
00:01:10,560 --> 00:01:13,470
folder so this car would be living at wherever you downloaded it.

21
00:01:13,470 --> 00:01:16,650
But within unity, when you bring something in your importing it.

22
00:01:16,650 --> 00:01:22,530
So if I right click on this vehicle show in Explorer, you'll see that this is now within my assets

23
00:01:22,530 --> 00:01:27,420
directory, which is in my repo, which is where my entire project is living.

24
00:01:27,420 --> 00:01:30,930
So it's now on my hard drive, right, with my project.

25
00:01:30,930 --> 00:01:35,550
Now the first step in the process is we need to make sure that the things are of the same size.

26
00:01:35,550 --> 00:01:39,480
So if I drag a car into my scene, it will be this sort of size.

27
00:01:39,480 --> 00:01:42,090
It's a little bit larger than the car I was using before.

28
00:01:42,120 --> 00:01:42,750
That's fine.

29
00:01:42,750 --> 00:01:44,640
If I drag in a house, you'll see.

30
00:01:44,640 --> 00:01:47,370
Oh, it's quite tiny if I drag in a road.

31
00:01:47,370 --> 00:01:51,090
So this double piece of road, it's sort of it's close.

32
00:01:51,090 --> 00:01:53,160
It's nearly where I want it to be for my vehicle.

33
00:01:53,160 --> 00:01:55,140
And there's a couple of ways for us to change the size of these.

34
00:01:55,140 --> 00:02:00,720
So obviously we could scale so click on my scale tool or hit R on my keyboard and then I'm going to

35
00:02:00,760 --> 00:02:02,790
say, there we go and we scale it.

36
00:02:02,790 --> 00:02:06,660
But that's a little bit inefficient because each time I drag one of these things in, I'm going to have

37
00:02:06,660 --> 00:02:08,340
to scale that individual piece.

38
00:02:08,340 --> 00:02:09,990
So there's another way we can go about doing this.

39
00:02:09,990 --> 00:02:14,640
But first, I want to give you a little bit of information about what we're doing in sprites and pixels

40
00:02:14,640 --> 00:02:15,180
in general.

41
00:02:15,180 --> 00:02:18,060
So you've got the context and sprites are made up of pixels.

42
00:02:18,060 --> 00:02:19,500
They're an image, any image.

43
00:02:19,500 --> 00:02:22,980
So this image you see here on the screen, this font you see in the screen, the background you see

44
00:02:22,980 --> 00:02:26,040
on the screen, it has pixels and pixel.

45
00:02:26,040 --> 00:02:30,600
Art is a type of art style, which basically means you just make the pixels very obvious.

46
00:02:30,600 --> 00:02:35,310
But in general, when you're working with an image, a jpeg, a bitmap, anything like that, it's consists

47
00:02:35,310 --> 00:02:39,690
of pixels and resolution refers to the number of pixels you have in image.

48
00:02:39,690 --> 00:02:41,700
So high resolution means more pixels.

49
00:02:41,700 --> 00:02:45,600
We use my little example here of Hunt, you can see that it's an eight by eight.

50
00:02:45,600 --> 00:02:48,600
So there's 64 pixels within my object here.

51
00:02:48,600 --> 00:02:50,730
One, two, three, four, five and so on.

52
00:02:50,730 --> 00:02:52,860
And pixels have a certain information.

53
00:02:52,860 --> 00:02:56,160
So this pixel is black, this pixel is red and so on.

54
00:02:56,160 --> 00:02:58,290
Okay, so that's one piece of information I want you to understand.

55
00:02:58,290 --> 00:03:03,720
The next piece of information is that unity has units, unity units, and one unity unit has no real

56
00:03:03,720 --> 00:03:04,110
meaning.

57
00:03:04,110 --> 00:03:05,670
It's just whatever we want it to represent.

58
00:03:05,670 --> 00:03:09,960
It could be meters or kilometers or miles or inches or whatever we want.

59
00:03:09,960 --> 00:03:14,010
So when you see in your transform, you see three, two, zero.

60
00:03:14,040 --> 00:03:18,840
That's saying we're at the position of three on the x axis and two on the Y axis, but it's not saying

61
00:03:18,840 --> 00:03:20,970
three kilometers or three miles or three, whatever.

62
00:03:20,970 --> 00:03:26,040
So when I scroll in here and have a look at my previous car, it's a position six and zero one on the

63
00:03:26,040 --> 00:03:26,280
Y.

64
00:03:26,310 --> 00:03:34,650
So if I move this back to say 000, you can see that we have something that is touching the top of this

65
00:03:34,650 --> 00:03:39,720
grid line and the bottom of that grid line, which is a way of saying it's two unity units in height.

66
00:03:39,720 --> 00:03:44,940
And if I move it over to the right, you'll see most likely it's one unity unit to the left and to the

67
00:03:44,940 --> 00:03:45,180
right.

68
00:03:45,180 --> 00:03:46,350
So across the x axis.

69
00:03:46,350 --> 00:03:49,020
So you see each of these squares here is one unity unit.

70
00:03:49,020 --> 00:03:53,010
And so when you look at your game objects, you can say, well, is this house correct?

71
00:03:53,010 --> 00:03:54,750
Do I want my house to be whatever?

72
00:03:54,750 --> 00:03:56,910
This is kind of three unity units.

73
00:03:56,910 --> 00:04:01,590
Maybe a unity unit is a kilometer, but that makes this house gigantic.

74
00:04:01,590 --> 00:04:03,420
So far too big, maybe.

75
00:04:03,420 --> 00:04:08,010
And what I normally think of a unity unit is around a meter just because that helps me.

76
00:04:08,010 --> 00:04:12,300
So when I look at this new car graphic that I've brought into my scene, if I click on it, you can

77
00:04:12,300 --> 00:04:18,630
see just move it to a space just here that it's around about one and a half, maybe nearly two unity

78
00:04:18,630 --> 00:04:24,210
units wide and around about three feet high, which is kind of similar to what a car is.

79
00:04:24,210 --> 00:04:27,420
A car would be around about three meters by one and a half to two meters.

80
00:04:27,420 --> 00:04:28,110
So that's cool.

81
00:04:28,110 --> 00:04:32,940
I'm going to leave this car as it is and say everything else is going to work with the size of the car.

82
00:04:32,940 --> 00:04:34,380
So I need the house bigger.

83
00:04:34,380 --> 00:04:39,150
And so back to my information I was showing you here we have something called pixels per unit, so a

84
00:04:39,150 --> 00:04:44,550
new asset will default to 100 pixels per unity unit when we bring it in.

85
00:04:44,550 --> 00:04:46,440
So let's go and have a look at this original image.

86
00:04:46,440 --> 00:04:49,020
So remember here, this is the assets we're drawing from.

87
00:04:49,020 --> 00:04:53,670
This is on our hard drive and then we can put a whole bunch of these into our scene where making copies

88
00:04:53,670 --> 00:04:57,120
or instances of these within our scene, I'll just undo all of those.

89
00:04:57,120 --> 00:04:58,950
But it's only living once right here.

90
00:04:58,950 --> 00:05:02,220
If I click on this car, then I can find my pixels.

91
00:05:02,360 --> 00:05:04,940
A unit is 100 because it defaults at 100.

92
00:05:04,970 --> 00:05:09,830
That means that for every one of these units in units, we have 100 pixels of my car.

93
00:05:09,860 --> 00:05:11,140
To show this even more clearly.

94
00:05:11,150 --> 00:05:11,750
Here's my car.

95
00:05:11,750 --> 00:05:13,970
If I zoom in a whole bunch, this is in Photoshop.

96
00:05:13,970 --> 00:05:15,770
You don't need to worry about where this is.

97
00:05:15,770 --> 00:05:19,310
I just want to show you this because it's easier to illustrate if I zoom all the way in, you can see

98
00:05:19,310 --> 00:05:20,420
that's a pixel.

99
00:05:20,420 --> 00:05:23,570
That's a pixel, that's a pixel and so on.

100
00:05:23,600 --> 00:05:24,770
Zoom back out again.

101
00:05:24,770 --> 00:05:28,340
And this image is we'll have a look at the image size.

102
00:05:28,340 --> 00:05:32,600
Image size is 182 wide by 354 high.

103
00:05:32,630 --> 00:05:37,880
That means that from left to right, we have 182 pixels.

104
00:05:37,880 --> 00:05:38,810
So you can count them up.

105
00:05:38,810 --> 00:05:42,110
You see these little gray and white squares up here.

106
00:05:42,110 --> 00:05:48,740
You could count those one, two, three, four, five, and you would count 182 across and 300 and whatever

107
00:05:48,740 --> 00:05:49,670
it was wide.

108
00:05:49,670 --> 00:05:51,980
So jumping back into unity, you can see, oh yeah.

109
00:05:51,980 --> 00:05:59,060
So if it's 182 from this mirror to this mirror, that's roughly just a little bit under two unity units

110
00:05:59,060 --> 00:06:05,240
because we're saying 100 pixels per unit, so 100 pixels and then we have another 82 pixels.

111
00:06:05,240 --> 00:06:06,890
Yes, that's around about what it is.

112
00:06:06,890 --> 00:06:08,510
So that's what we've brought it in as.

113
00:06:08,510 --> 00:06:12,890
So if I click on my house now in the assets area, find pixels per unit.

114
00:06:12,890 --> 00:06:19,100
What we see on my slide here, if I want an image to be bigger than I want less pixels per unit, let

115
00:06:19,100 --> 00:06:21,560
me demonstrate that and that'll I think make a bit more sense.

116
00:06:21,560 --> 00:06:27,140
So on here, if I say it's currently 100 pixels per unit, let's make it 50 pixels per unit and then

117
00:06:27,140 --> 00:06:28,520
click all the way down the bottom.

118
00:06:28,520 --> 00:06:30,830
You might have this display in the way or you might not.

119
00:06:30,830 --> 00:06:35,030
You can grab the little double lines and push it out of the way and then click apply.

120
00:06:35,030 --> 00:06:36,980
That will make the house appear bigger.

121
00:06:36,980 --> 00:06:38,870
Now it hasn't given it more pixels.

122
00:06:38,870 --> 00:06:43,880
This is the same number of pixels, but it's saying for every unit, unit, a unit of our image, we're

123
00:06:43,880 --> 00:06:46,610
going to use 50 of the pixels to fill that.

124
00:06:46,610 --> 00:06:50,540
If I was to make this say 200, it would take it the other way.

125
00:06:50,540 --> 00:06:51,380
I'll hit apply.

126
00:06:51,380 --> 00:06:52,970
That will make the house quite small.

127
00:06:52,970 --> 00:06:53,450
Where'd it go?

128
00:06:53,450 --> 00:06:54,050
It's so small.

129
00:06:54,050 --> 00:06:54,650
I've lost it.

130
00:06:54,650 --> 00:06:57,290
Let's make sure it's not an order layer order issue.

131
00:06:57,440 --> 00:06:59,300
Yeah, it's sitting below the road.

132
00:06:59,300 --> 00:06:59,810
There it is.

133
00:06:59,810 --> 00:07:05,660
So I went the other way and increased the number of pixels on my original sprite image down here, pixels

134
00:07:05,660 --> 00:07:07,280
per unit and that made it a lot smaller.

135
00:07:07,280 --> 00:07:11,780
Now it's saying, okay, we'll get 200 of these pixels into one unity unit.

136
00:07:11,780 --> 00:07:16,670
I think 25 is going to be the right amount, which is another way of saying it's four times as large

137
00:07:16,670 --> 00:07:22,160
as when I first brought it into this world and therefore, it's going to be.

138
00:07:22,160 --> 00:07:22,580
What's that?

139
00:07:22,580 --> 00:07:25,430
Well, these larger lines are going to represent ten unity units.

140
00:07:25,430 --> 00:07:30,410
You can see the grids I've got on here as you scroll out, different ones become darker.

141
00:07:30,410 --> 00:07:32,030
So it's going to be about a ten meter house.

142
00:07:32,030 --> 00:07:33,080
Is that how big a house is?

143
00:07:33,080 --> 00:07:35,210
I don't actually know, but I think it's close enough.

144
00:07:35,210 --> 00:07:35,590
Okay.

145
00:07:35,600 --> 00:07:39,890
So we've got also we've got other cars, we've got other houses, we've got roads, rocks and stuff.

146
00:07:39,890 --> 00:07:42,800
If we throw a few of these in, you see those trees are a bit too small.

147
00:07:42,800 --> 00:07:45,830
Those rocks, I'm not sure that tree is a bit small, that tree.

148
00:07:45,830 --> 00:07:49,790
So what I want you to do is a challenge to set up the assets in your scene so that they look like the

149
00:07:49,790 --> 00:07:51,590
right size compared to each other.

150
00:07:51,590 --> 00:07:57,500
And little hint, you can highlight multiple sprites and change their pixels per unit at the same time.

151
00:07:57,500 --> 00:07:58,190
So there you go.

152
00:07:58,190 --> 00:08:00,560
Take on that challenge and I'll see you back here when you're done.

153
00:08:02,660 --> 00:08:02,960
Okay.

154
00:08:02,990 --> 00:08:04,550
So I'm going to drop my other houses in there.

155
00:08:04,550 --> 00:08:08,270
It looks like they've got the same sort of proportion as our first one.

156
00:08:08,270 --> 00:08:14,110
Highlight both of those and then find pixels per unit 25 click on apply blink.

157
00:08:14,120 --> 00:08:16,430
That makes them roughly the right size for the houses.

158
00:08:16,430 --> 00:08:17,360
That's cool.

159
00:08:17,540 --> 00:08:18,500
One, two, three.

160
00:08:18,500 --> 00:08:21,050
And then I'm going to click on my road piece.

161
00:08:21,050 --> 00:08:24,530
All of my road pieces I believe are going to look proportionate to each other.

162
00:08:24,530 --> 00:08:26,090
Yeah, well, that's the same one I brought in before.

163
00:08:26,120 --> 00:08:27,050
That doesn't help, does it, Rick?

164
00:08:27,050 --> 00:08:28,280
Yeah, that's the same.

165
00:08:28,280 --> 00:08:32,360
So I'm going to highlight all of my row pieces shift and then highlight, and then I'm going to control,

166
00:08:32,360 --> 00:08:36,650
control, control, control while I'm clicking, holding down control, clicking on the bridge, all

167
00:08:36,650 --> 00:08:37,640
the bits of road.

168
00:08:37,640 --> 00:08:39,740
What I want to do, I make these a little bit bigger.

169
00:08:39,740 --> 00:08:45,200
So I'm going to say 75 pixels per unit apply there so as to go through all of these.

170
00:08:45,200 --> 00:08:46,100
Think about it, think about it.

171
00:08:46,100 --> 00:08:49,790
And the one that we've got in the world looks like it's a little bit bigger now, which is cool.

172
00:08:49,790 --> 00:08:54,080
The rocks, I think are good enough and all of these trees, I get the feeling that they are all too

173
00:08:54,080 --> 00:08:57,920
small, so I'm going to make those 50 and see how that looks.

174
00:08:58,820 --> 00:09:00,920
Is that the right size tree versus car?

175
00:09:00,920 --> 00:09:04,100
You're not going to make my trees much bigger, so I'm going to do these 25 as well.

176
00:09:04,100 --> 00:09:05,360
25.

177
00:09:05,390 --> 00:09:06,920
Okay, that's a bigger sort of tree.

178
00:09:06,920 --> 00:09:10,310
And you know, just to reiterate, once you've done that, you could get in there and scale it, make

179
00:09:10,310 --> 00:09:13,490
this one a little bit bigger, duplicate it, make another one a little bit smaller.

180
00:09:13,490 --> 00:09:14,840
So you've got some variation.

181
00:09:14,840 --> 00:09:21,320
Just because we make one of these 25 pixels per unit doesn't mean we can't then go and modify an individual

182
00:09:21,320 --> 00:09:23,510
game object that we've put into our world.

183
00:09:23,510 --> 00:09:26,180
Okay, so we've got our assets set up in the next video.

184
00:09:26,240 --> 00:09:28,610
We might just lay out a little bit of a map to work with.

185
00:09:28,610 --> 00:09:29,930
So great work in this lecture.

186
00:09:29,930 --> 00:09:30,980
I'll see you in the next one.

