Configuring the game camera
The preceding code allows you to control the Player
object, but there are some problems. One of them is that the player doesn't seem to face the position of the mouse cursor, even though our code is designed to achieve this behavior. The reason is that the camera, by default, is not configured as it needs to be for a top-down 2D game. We'll fix this in this section. To get started, the scene camera should have a top-down view of the scene.
To achieve this, switch the Scene viewport to a top-down 2D view by clicking on the ViewCube, the up arrow in the top right corner of the Scene viewport. This switches your viewport to a top view. See Figure 3.17:
You can see that the viewport is in a top view because the viewcube will list Top as the current view. See Figure 3.18:
From here, you can have the scene camera conform to the viewport camera exactly, giving you an...