Setting Up A Camera
Our Home will have a fixed position perspective camera which will move on the horizontal access to remain between the two players and will never rotate on any axis. This camera style will be incredibly simple to program as the camera will only need to move along one axis. The problem that may occur is that players may run of the edge of the screen however our levels will be small and designed to ensure that the players cannot escape the camera.
Due to a small amount of programming demands in the project right now I have the luxury of trying out whatever I think will work well for this game which will allow me to add small touches that will improve what is known as "Game Feel".
My first little addition was to make the camera move in a smooth fashion so as not to be jarring to the player. If the camera was just automatically moving exactly to the middle point between the two players it would jump from point to point rapidly which would feel horrible for anyone looking at the screen. To get the effect i wanted instead of making the camera move between the players, i made an invisible object called the "Camera Arm" move to the exact position and then made the camera slowly lerp towards the Camera Arm. This resulted in a slow movement to the right position whilst the Camera Arm was always finding the correct spot.
My second addition is a camera transition system. If you've ever played a game that started off with swooping camera movements to show you the environment you are in then you know exactly what I'm looking for here. This was relatively simple to do with it all being done by creating points for the camera to reach and bools saying whether it has reached this point or not. The hardest part of this was instructing the camera what direction it needed to point in once it has reached its position, however it came down to just turning off one script and turning another on once the camera's y value was within a certain range.
These are the first two extra bits I have added to the camera, however I hope to have time to add much more