[MUSIC] In this video we'll set up the camera for our game. Our objectives will be to position the camera to get it to follow the player, modify the background that the camera sees, and add music to the camera. So the first thing we need to do is position our camera. So I'm gonna go ahead and tap on the roller ball and press the f key to zoom in. And you can see that the roller ball, the little axis gizmo, the z-axis is blue of course and the arrow is pointing in the positive direction. The way the controller works for the ball is, when you press forward, it applies force in the positive direction. So it'll push the ball in the positive z direction. So essentially we want our camera to be looking down that z-axis. So we need to decide kind of the distance. I'll back up a little bit so we can see a little bit more of the world. And maybe go a little bit off that axis so we can get a little more interesting view on the world, so mostly down with the z-axis but slightly off the side. So now we've got our scene view roughly the way we want our camera to look, but now we need to change the camera itself, so notice the game view hasn't changed. So we did this in the first project, we'll go ahead and select the main camera. Go to GameObject and then pick Align With View. So that will make the GameObject of the camera align with the view in the scene window. So you can see that our game view is now updated. If we go ahead and play, you’ll see that, as I move the ball, we’ve got that view. But of course the camera is not following the ball. So, one thing that we did in the first project, is we used parent-child relationships to resolve this sort of issue with the moon rotating around the Earth as an example, so one idea is, well, let's make the camera a child of the roller ball so it follows the ball as it moves. So, let's try that. Go ahead and drag the Camera into the RollerBall. So now it's a child. So let's go ahead and test this. And as I move forward, you can see, woah, what's going on? The camera's going all out of control as the ball rolls. And this really makes sense, because the camera is a child of the ball, and as the ball is rotating, the child looks to the parent's coordinate system. And that coordinate system is constantly rotating, so it essentially rotates around the ball as the ball rolls. Of course we don't want that, let's go ahead and stop. So we're gonna pull the camera outside of the ball, back to be at the top level. So let's look at one feature of the scene view. So let me click back on the ball. Right now we are in what's called Global Mode, which shows the axes of the world coordinate system, so as I move this it's in relationship to the world. If I hit play and move the ball around, notice that up is always up to the world and forward is always forward. If I change this to Local Mode, by clicking on where it says Global here, now notice that the little gizmo spins. So this is actually reflective of the local coordinate system of the ball, so you can see that the z direction is constantly changing and so forth. So this is a nice feature to kind of realize what's actually happening in the parent-child relationship with the parent's coordinate system. So, when you're in Editing Mode, you could always switch back and forth, and since this is essentially oriented to the world initially, you can't really tell a difference, but sometimes, if this was a rotated ball to start with, the local and the global would be different. So, how are we gonna get the camera to actually follow the ball? This is where scripting comes in, so let me go ahead to the Main Camera. And we're gonna add a component. So, in the Standard Assets, we brought in the Utility assets, and one of those is called SmoothFollow. So we're gonna attach this SmoothFollow script, let me just drag and drop it into the inspector for the Main Camera, and what this will do is make a game object follow another game object. In this case, the camera will follow the roller ball. So we need to set the target of what to follow. So let's go ahead and set that as the RollerBall. We need to set a Distance. I'm gonna maybe make the Distance about 6 and the height, I'm gonna leave it at 5 and see what we get here. Okay, so I’ll go ahead and press play, and we’ve got roughly a similar view that we had before. And as I move around, notice that the camera is smoothly following the roller ball, and that’s exactly what we want. Let’s go ahead and stop. The other thing to notice, is that we’ve got default Skybox here, which is not really the look that I want for my game. So I could go and make my own custom Skybox as we did the first project, but really, I could just get away with a solid color. So let me look at the camera settings up here. Under the Camera component, you can see it says Clear Flags, Skybox. That basically means it's gonna render the Skybox. If I click the drop-down here, I can switch to Solid Color, which basically means it's not gonna render the, but it's gonna show a background color as specified here. And here you can see it turns dark blue. So I'm gonna go ahead and click on the color to bring out the color picker. I wanna pick a very dark red sky. Of course you can do whatever color you want. But I'm gonna make mine you know a very dark red, just sort of an off black. And I've got the sky the way I want it. Okay, the last thing that I'm gonna do on my camera is add some music. Remember the main camera has an audio listener component on it by default. Therefore the camera, is a good place to actually add music since it'll always be a constant distance away from the audio listener. If you put music on a different object in the world, and as the camera moves closer and farther away, the actual 3D positioning will make the volume of the music sound less or more as you get closer or farther away from it. So, like I said, the camera is a really good place to place an audio source when you want it to be a constant volume. So I'm gonna go ahead and click Add Component and go down to Audio, and of course we've already got the Audio Listener component by default on the camera. So let's add the Audio Source component and go ahead and open up the Properties. We need to specify a clip. It's looking for an AudioClip. If I can hit the little target here. We actually have in the assets that we imported, we have background music. So let me go ahead and add that. And if I play this [MUSIC], you can hear we have music. It's a little bit loud, so I'm gonna go ahead and reduce this and I'm gonna make it about 25%. Regular volume. And I also want this to loop because this music is seamless, so I want it to constantly play as the game plays. And let's go ahead and play the game again. [MUSIC] So we have that music playing constantly. We have the camera following the ball and positioned the way we want it positioned. In the next video, we'll organize our project a bit. [MUSIC]