In this lecture we're going to enhance the previous application that we made by adding headlights to
our cars.
Now I don't know if you've noticed it or not but the change that we're using on the ground plane will
also receive lots which is really handy to sit this up just grab hold of your family car and we want
to find the Mokka.
So in the image track in the hierarchy click on the family car double click to find where it is and
then click on the preview to make sure that you get that Mark visible.
You'll want to then go into a vehicle prefabs and drag and drop a copy of the family car onto the family
car track.
Now when you first put it on it will be up in the air because if you remember back to when we first
set up these prefabs we had them up and they said that they will fold down when they are first instantiated.
But as we're adding the spotlights for the car we actually want to see them as we're doing this or what
I've done is I've just already moved these pre-fab.
Dan you want to kind of see it wherever it's going to be on the marker so you can see how these lots
are going to appear.
Now of course it won't have any wheels because that gets automatically put on the car by the script
when it runs.
What we're going to do now is select the family car game object itself and right click on it.
Let's go to laut and spotlight that will add a spotlight as a child to your car.
Now you can say I've got a lot being projected on that plane.
So everything we need to get this going is already there.
All you have to do is basically add the spotlights and then position them wherever you want them to
be on the car.
At least with lights coming from.
In fact let me put these at 0 0 or as far as the law is concerned.
And I'll put them in these slots which are obviously for the headlights which is their that wrought.
And you probably want it angled down a little bit.
So we'll just bring that in of course you can adjust it however you want.
Then we will control D and make another one and just
bring that across to the light position.
So we've now got two headlights on that come right.
So now that the children of the car you can select the car itself and then lift it back up again into
the sky which is where you want to start from when you press play.
And we will click on apply over in the inspector to make sure that those spotlights are applied to that
car pre-fab and we'll get them automatically right.
So now that we've done that we can delete this car that we're using before because remember the car
to be instantiated is still in the durables up here.
OK so let's try this out.
All right so Mark let's just bring the car up and there's our headlights and we should be able to drive
and have the headlights appear in the real world.
As well so that's a really easy way for you to add that extra functionality into your applications.
So you might like to go ahead now buy yourself an ad your headlights for all of the other vehicles.