In this lecture, we're bringing in some assets into our game and just making sure they are all the
right proportions in relation to one another.
So let's get started.
Let's start the process by bringing in the assets that I've given you so you can find those in the resources,
which is against this lecture, either to the right of the video or down the bottom of the video, depending
upon where you're watching this.
And you'll see a delivery driver assets downloadable file.
So download that and when you do, you'll see a zip file.
What you need to do is to unzip that on windows.
You go right click, extract all and you can unzip that on Mac.
You can go through a similar process for unzipping that once you do that, you'll see a folder which
has some assets in it, some nifty cars and roads.
Now there's a really easy process when you're working with sprites like this, you can grab your folder
and just drag it straight into your assets directory and this entire folder will be brought in.
You can do the same one asset at a time.
So I could click here and just bring in the car, for example, and do that one at a time.
But bringing the whole folder, you should see that the delivery driver assets folder now exists within
Unity.
And interestingly, in some applications it would keep the connection to wherever you downloaded that
folder so this car would be living at wherever you downloaded it.
But within unity, when you bring something in your importing it.
So if I right click on this vehicle show in Explorer, you'll see that this is now within my assets
directory, which is in my repo, which is where my entire project is living.
So it's now on my hard drive, right, with my project.
Now the first step in the process is we need to make sure that the things are of the same size.
So if I drag a car into my scene, it will be this sort of size.
It's a little bit larger than the car I was using before.
That's fine.
If I drag in a house, you'll see.
Oh, it's quite tiny if I drag in a road.
So this double piece of road, it's sort of it's close.
It's nearly where I want it to be for my vehicle.
And there's a couple of ways for us to change the size of these.
So obviously we could scale so click on my scale tool or hit R on my keyboard and then I'm going to
say, there we go and we scale it.
But that's a little bit inefficient because each time I drag one of these things in, I'm going to have
to scale that individual piece.
So there's another way we can go about doing this.
But first, I want to give you a little bit of information about what we're doing in sprites and pixels
in general.
So you've got the context and sprites are made up of pixels.
They're an image, any image.
So this image you see here on the screen, this font you see in the screen, the background you see
on the screen, it has pixels and pixel.
Art is a type of art style, which basically means you just make the pixels very obvious.
But in general, when you're working with an image, a jpeg, a bitmap, anything like that, it's consists
of pixels and resolution refers to the number of pixels you have in image.
So high resolution means more pixels.
We use my little example here of Hunt, you can see that it's an eight by eight.
So there's 64 pixels within my object here.
One, two, three, four, five and so on.
And pixels have a certain information.
So this pixel is black, this pixel is red and so on.
Okay, so that's one piece of information I want you to understand.
The next piece of information is that unity has units, unity units, and one unity unit has no real
meaning.
It's just whatever we want it to represent.
It could be meters or kilometers or miles or inches or whatever we want.
So when you see in your transform, you see three, two, zero.
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
three kilometers or three miles or three, whatever.
So when I scroll in here and have a look at my previous car, it's a position six and zero one on the
Y.
So if I move this back to say 000, you can see that we have something that is touching the top of this
grid line and the bottom of that grid line, which is a way of saying it's two unity units in height.
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
right.
So across the x axis.
So you see each of these squares here is one unity unit.
And so when you look at your game objects, you can say, well, is this house correct?
Do I want my house to be whatever?
This is kind of three unity units.
Maybe a unity unit is a kilometer, but that makes this house gigantic.
So far too big, maybe.
And what I normally think of a unity unit is around a meter just because that helps me.
So when I look at this new car graphic that I've brought into my scene, if I click on it, you can
see just move it to a space just here that it's around about one and a half, maybe nearly two unity
units wide and around about three feet high, which is kind of similar to what a car is.
A car would be around about three meters by one and a half to two meters.
So that's cool.
I'm going to leave this car as it is and say everything else is going to work with the size of the car.
So I need the house bigger.
And so back to my information I was showing you here we have something called pixels per unit, so a
new asset will default to 100 pixels per unity unit when we bring it in.
So let's go and have a look at this original image.
So remember here, this is the assets we're drawing from.
This is on our hard drive and then we can put a whole bunch of these into our scene where making copies
or instances of these within our scene, I'll just undo all of those.
But it's only living once right here.
If I click on this car, then I can find my pixels.
A unit is 100 because it defaults at 100.
That means that for every one of these units in units, we have 100 pixels of my car.
To show this even more clearly.
Here's my car.
If I zoom in a whole bunch, this is in Photoshop.
You don't need to worry about where this is.
I just want to show you this because it's easier to illustrate if I zoom all the way in, you can see
that's a pixel.
That's a pixel, that's a pixel and so on.
Zoom back out again.
And this image is we'll have a look at the image size.
Image size is 182 wide by 354 high.
That means that from left to right, we have 182 pixels.
So you can count them up.
You see these little gray and white squares up here.
You could count those one, two, three, four, five, and you would count 182 across and 300 and whatever
it was wide.
So jumping back into unity, you can see, oh yeah.
So if it's 182 from this mirror to this mirror, that's roughly just a little bit under two unity units
because we're saying 100 pixels per unit, so 100 pixels and then we have another 82 pixels.
Yes, that's around about what it is.
So that's what we've brought it in as.
So if I click on my house now in the assets area, find pixels per unit.
What we see on my slide here, if I want an image to be bigger than I want less pixels per unit, let
me demonstrate that and that'll I think make a bit more sense.
So on here, if I say it's currently 100 pixels per unit, let's make it 50 pixels per unit and then
click all the way down the bottom.
You might have this display in the way or you might not.
You can grab the little double lines and push it out of the way and then click apply.
That will make the house appear bigger.
Now it hasn't given it more pixels.
This is the same number of pixels, but it's saying for every unit, unit, a unit of our image, we're
going to use 50 of the pixels to fill that.
If I was to make this say 200, it would take it the other way.
I'll hit apply.
That will make the house quite small.
Where'd it go?
It's so small.
I've lost it.
Let's make sure it's not an order layer order issue.
Yeah, it's sitting below the road.
There it is.
So I went the other way and increased the number of pixels on my original sprite image down here, pixels
per unit and that made it a lot smaller.
Now it's saying, okay, we'll get 200 of these pixels into one unity unit.
I think 25 is going to be the right amount, which is another way of saying it's four times as large
as when I first brought it into this world and therefore, it's going to be.
What's that?
Well, these larger lines are going to represent ten unity units.
You can see the grids I've got on here as you scroll out, different ones become darker.
So it's going to be about a ten meter house.
Is that how big a house is?
I don't actually know, but I think it's close enough.
Okay.
So we've got also we've got other cars, we've got other houses, we've got roads, rocks and stuff.
If we throw a few of these in, you see those trees are a bit too small.
Those rocks, I'm not sure that tree is a bit small, that tree.
So what I want you to do is a challenge to set up the assets in your scene so that they look like the
right size compared to each other.
And little hint, you can highlight multiple sprites and change their pixels per unit at the same time.
So there you go.
Take on that challenge and I'll see you back here when you're done.
Okay.
So I'm going to drop my other houses in there.
It looks like they've got the same sort of proportion as our first one.
Highlight both of those and then find pixels per unit 25 click on apply blink.
That makes them roughly the right size for the houses.
That's cool.
One, two, three.
And then I'm going to click on my road piece.
All of my road pieces I believe are going to look proportionate to each other.
Yeah, well, that's the same one I brought in before.
That doesn't help, does it, Rick?
Yeah, that's the same.
So I'm going to highlight all of my row pieces shift and then highlight, and then I'm going to control,
control, control, control while I'm clicking, holding down control, clicking on the bridge, all
the bits of road.
What I want to do, I make these a little bit bigger.
So I'm going to say 75 pixels per unit apply there so as to go through all of these.
Think about it, think about it.
And the one that we've got in the world looks like it's a little bit bigger now, which is cool.
The rocks, I think are good enough and all of these trees, I get the feeling that they are all too
small, so I'm going to make those 50 and see how that looks.
Is that the right size tree versus car?
You're not going to make my trees much bigger, so I'm going to do these 25 as well.
25.
Okay, that's a bigger sort of tree.
And you know, just to reiterate, once you've done that, you could get in there and scale it, make
this one a little bit bigger, duplicate it, make another one a little bit smaller.
So you've got some variation.
Just because we make one of these 25 pixels per unit doesn't mean we can't then go and modify an individual
game object that we've put into our world.
Okay, so we've got our assets set up in the next video.
We might just lay out a little bit of a map to work with.
So great work in this lecture.
I'll see you in the next one.