In his lecture, we're going to lay out a simple level that we can drive our car around and give a little
bit of meaning to our game world.
First of all, when I click on play, I'm still driving around my capsule.
We don't want that.
Let us do a change.
So we drive around our car.
Now, this is really simple.
If you click on Cruising Drive, you'll see that under Sprite Renderer we have the Sprite.
So saying, What visual representation do you want of this particular game object?
If you click on the little target, select the thing next to where it says Capsule.
Then you'll see that we've got all of the sprites that we've just brought into our game.
If you don't see them, you could always type in the search box for car and then you'll see them listed
out here.
CAR One, two, three.
So I want you to select one of these cars, either one or two or three.
I'm going to use car three.
I quite like it.
Double click on that.
And now when I click on play, I should be driving around but but above driving around a car.
Cool.
One thing you'll notice though is as I drive over here, if I get close to this thing that I should
be bouncing into, it's like, Oh, I don't bounce into it until I've practically over the top of it,
till my wheels smacking into it.
And so let's have a look at why that's happening.
If I move my car a little bit down here, it's going to click on my other car and just delete that.
That was just an image hanging out or is this is my game object that's driving?
If I turn off the Sprite renderer on and off, you can see that we've got our box collider is too small.
So what can we do for that?
Well, scroll in a bit so I can see if you find the box collider and just while I'm here we say this
capsule collider I'm going to right click and remove component to delete that.
I thought I did that before, but maybe I didn't.
So we have our box.
Collider If you see where it says Edit.
Collider Click on the little button there.
Now we've got some handles, these green dots down the end of our box here and you can move them so
that your collision box fits exactly where you want it to fit.
So I'm going to put mine just slightly within the frame of my vehicle here and then down to the end.
There we go.
Now, our collision should allow us to bump into things more cleanly when we're driving around.
So drive, drive, drive, bulk.
Okay.
The other thing I'm going to do while I'm here just super quickly is click on the main camera and give
ourselves a little bit more view because we're a bit too close, aren't we?
It's a bit hard to see what's going on now.
Well, just here to close the car so we see it under camera.
It says size.
That allows us to change the size or in other words, change how close we look like we are to our world.
So go ahead and make that whatever setting you want.
You don't need to do the same as mine, but I'll probably make mine about 12 I think looks pretty good.
Next, what we want to do is organize our hierarchy a little bit so we don't just have a big old mess
of stuff that we've popped in there.
The way we do this is with empty game objects.
So if you right click in your hierarchy, click Create Empty and you'll see it says Game Object Highlighted.
I'm going to type in here World Objects.
You can call it whatever you want world objects or environment or trees or what have you.
Now it's good practice to come over to the transform on this empty game object.
It's an empty game object because there's nothing there.
There's no component has a transform because everything has a transform.
But there's nothing else to say what it is.
It's just an empty thing.
It's a container that allows us to do grouping and categorization, which is cool.
So I'm going to right click on Transform and just click on Reset that will reset it back to 000.
Just so I know that this empty game object is right in the middle of the world.
Just one of those things.
It doesn't matter a lot just yet, but it's a good practice because there'll be things in the future
where you want to know that it's 000 for all of these aspects.
Now I'm going to highlight all of my things that I've randomly dropped in there the houses and the rocks
and the trees and stuff.
And I'm going to after highlighted them so shift and then click from one point shift and then click.
I'm going to hold down left mouse button and drag all of those on top of world objects, not below where
you see the blue line or above just right on top bunk.
And that means that these are now childhood underneath world objects.
The world object is the parent and all these things are the children.
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
that noise in my hierarchy.
It also means if I click on World Objects, for example, that will grab everything below that as well.
And I can move everything around at the same time that's within that particular grouping of game objects
or as we would say, children underneath the parent.
Okay, while we're here, I've got three houses.
I'm going to click on each of these three houses, so a click and then hold shift and then click again.
You can see it highlighted them in the world and highlighted in our hierarchy.
And then I'm going to come over and add component box collider to DH, make sure you got the two D down
the end and you'll see that puts a box or a collision around the outside of these houses.
So if I try to drive through them Smash, I can't, I just bounce straight into them, which is cool.
That's what we want.
But we want to do the same for anything you add into the world that needs some sort of collision.
These trees we probably put around a circle to DH Collider, I think, rather than putting a box collider.
But we'll get to those in a moment after we've laid out our level and we've got stuff in there.
So I just wanted to show you that step at this point.
Now, what I want to do is to lay out a really basic level.
So to drop down some road, make some bends and some what have you, put some trees and houses, just
something really simple.
You can go crazy on this after we've finished working through the project, but for now we don't want
to over engineer this and spend too, too much time on it.
You could if you wanted things to snap now.
Nice and neatly.
You can click, make sure you click on Global and then click on the snapping mechanism next to it.
So it's highlighted and that means that when you move around things, they'll go click, click, click,
click and snap to each unity unit.
You can see over here it's going from -14, 15, 16, 17, and so on.
I'm going to turn that off and just be fast and loose and just sort of slap things down and not worry
so much.
If I've got little gaps in my roads, I'm not going to worry about precision yet because who knows?
Once we made our game, we might want to have a totally different layout.
So the challenge I've got for you now is make a simple neighborhood that your delivery driver can drive
around in.
And as you do this, don't worry about if it doesn't fit within your game window.
We're going to do something with the camera in upcoming lectures to make the camera follow the player.
So take up as much space as you want when you do that, but don't over engineer it because we will potentially
be changing things as we go.
And then please do share a screenshot of what you come up with.
So there you go, pause a video, take on that challenge.
See you back here when you're done.
Okay.
I'm going to go through this really quickly.
I'm going to rotate my first road piece.
Actually, I'm going to delete that one.
That's not the right one.
I'm going to get one of these big roads, drop that into the scene.
And I'm just going to speed up the video now here so you can see what I'm doing.
I'm starting out by getting a general feel of where I want things to be placed.
Just move the houses around a bit, a little bit, a lot of control d to duplicate things like houses.
Just make another one, make another one.
I've dropped in some rowdy kind of road pieces and I'm like, You know what?
A roundabout would make sense in the middle here.
So I pop that down, adding some trees.
I tried a square bit of road, but it didn't quite scale, so I popped in another roundabout in there
just to get the symmetry going.
A few more houses, a couple of trees, just a little bit of set dressing there to pop them around.
It's good to scale, rotate, make them look a little bit different so it doesn't look like you've just
dropped the same thing down over and over.
And just to get it a bit more interesting than just the roads, okay, now let's do a little test run
and make sure I can drive around my world.
Bump into things, bump, conclusion on that.
Bump, drive, drive.
Cool.
Okay, so obviously we can't see our whole level.
I can see it over in my scene view.
If I wanted to watch where my car is going, that's cool.
We need to get our camera to follow our player around.
There's a little basic level we can use.
You know what?
One last thing that's bugging me at the moment.
I don't like that the background is blue, so I'm going to find my camera, click on main camera.
I change the background color to be a grass kind of color.
So you're driving around, there's grass in the background.
It's not amazing, but it's a little bit better than the blue, I think.
And then we go, I've set myself up a basic little level we can use for the remainder of our project.
Okay, hopefully you've done a great job on yours as well.
I'd love to see it.
So please do share a screenshot and I'll see you in the next lecture.