This lesson will use Cinemachine and the Track and Dolly virtual camera to create a path for a camera to follow.
A dolly track is a path for a camera to follow. We will create an animation for the camera to follow.
First load a scene with an environment you with to have the camera move around.
In the example below the camera will follow the green track
Add a Dolly Camera with Track from the Cinemachine menu
This creates the Virtual Camera and the Dolly Track
Select the Dolly Track.
In the inspector there are waypoints. These are positions to move the camera to.
Now we need to record an animation to move the camera through.
Create an empty gameobject to manage the timeline and animations. In this example it is called TimelineManager.
Add a Playable Director component to the TimelineManager.
Create a Timeline object.
Attach the timeline to the Playable director.
Drag the camera with the Cinemachine brain on it to the Timeline.
Make sure that you have the TimelineManager object selected.
Drag the Virtual Camera with the track and dolly into the timeline
Press the record button.
In the virtual camera change the path position and match it against the frames where you want the camera to be.
Note 0 is the starting point, 1 is the first waypoint, 2 the second etc. 1.5 would be halfway between waypoint 1 and 2.
You will usually have to go back to the first frame and set the waypoint to 0
When finished click the record button again.
Press play to preview the animation