Part IV – The Event Sheet - The "CAMERA" Group
Lets face it. Cameras are a big deal in 3D. If you are making a 3D game, the camera is potentially the most complex part of giving the user a good experience. The sole purpose of the camera is to show the player what they need to know. In a top-down game, this means that you need to make sure that the player is always visible, with nothing obstructing the view of the player. For this reason, in this tutorial, we have intentionally not given the player the ability to drive under something.
One of the basic tenets of 3D game cameras is that the camera should move with the player. This means that if the player moves, the camera should "translate" instead of "rotating". Mathematically, this makes your life easy, as the simplest way to do this is:
1. Every tick, set the camerpoint to a (carbody.x+500,carbody.y+500,5000) - significantly above, and at a slight angle to the player. Note that we have kept the z height at 5000 so that we can see the player move with respect to the ground, rather than the ground moving with respect to the player. The latter can cause simulation sickness in some players.
2. Every tick, set the camera to the location of the camerapoint.
3. Every tick, rotate the camera toward the player.
The screenshot below shows the events for the camera.
I strongly recommend watching the following video for further guidance on game cameras:
50 Game Camera Mistakes (YouTube)