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 ...

Get Unity 4.x Game Development by Example Beginner's Guide now with the O’Reilly learning platform.

O’Reilly members experience books, live events, courses curated by job role, and more from O’Reilly and nearly 200 top publishers.