Time for action – set up the camera rig
We want to depict the player running through these hallways. There are at least two ways we can handle the animation of HallwayCam
. We can use a Script to control the camera motion, or we can use Unity's built-in animation tools to record some camera motion that we'll play back during gameplay. We've already done a bunch of scripting, so let's see what the Unity IDE can do to help us pull off our running-through-the-hallway effect without writing any code.
We're going to build a camera rig, where the camera is a child of a GameObject that bounces up and down, and that GameObject is a child of another GameObject that runs through the hallways.
Tip
Order of operations
Because of the way Unity's built-in animations work, it's super important to set up your objects' parent-child relationships before you animate. The values we set in our animation clips become relative to an object's parent. In short, that means "bad news" if you animate first before setting...