How to use a Dolly Track in Unity
Objective: use a dolly track to created an animated camera shot.
To create a dolly track, we use the Cinemachine menu at the top of the screen.
This creates dolly track and virtual camera objects in the hierarchy. If we already have set up a virtual camera, we can just delete the one that is automatically created.
Lets select the dolly track and make use of it. Dolly tracks allow objects to move between its waypoint. We create our first waypoint by clicking the large, self-explaining button in the CinemachinePath component.
You can add additional waypoints by pressing the + button here.
Once we have at least two waypoints, a green path will appear in the scene. It looks somewhat like a railroad. This shows the path that objects will take as they travel from one waypoint to the next. We can select and move the waypoints around like any other object.
Each waypoint also has a tangent that can moved to adjust which direction the path travels immediately after leaving or arriving at a waypoint.
To use this track, we can select the camera we want to move and set its body field to “Tracked Dolly”
Then, we drag the dolly track object into the path field.
Now this object will move along the track as we change the Path Position field.
As we change the Path Position from 0 to 1, the camera will move from waypoint 0 to waypoint 1.
Now to have this motion created automatically during the cutscene, we just record two keyframes in the timeline window. The first keyframe has the camera’s Path Position set to 0, and the second keyframe, just before the cut, has the Path Position set to 1.
Here is the animated shot, now completed with its dolly track movement. Swiveling the camera around in this arc gives us a nice view of the action from different angles.