Cleaning up shop
We left off with our Barrel Hopper project, having just implemented some respawning logic. In its current state our project is a basic prototype at best. During the course of this chapter we will be refining our previous implementations as well as adding new layers of polish via the inclusion of animation and sound effects. However, before we do this, we should clean up the functionality we already have in place.
As it is now, when our player dies we leave nothing in charge of the main camera. You may have noticed that, upon player collision with a barrel, the camera will disjoint and show a default view of the world's origin. We need to append to the functionality we created as an event delegate so that, when our player is destroyed, the game mode creates a new camera and sets it as our main view target. We can then interpolate from this new camera to our Player camera upon respawn to create a nice, clean respawn effect. Before we do this, I think now is a great time to...