Day 58 — Making use of a dolly track in Unity
Hey and welcome!
Today I’m going to go over how you can make use of the Dolly Track feature in Cinemachine. In the film industry a dolly track is a path that’s used to track a particular object and follow along with it.
At the moment I’m working on creating a game over cutscene using the Captured Cutscene animation located in the prefabs folder and the animation itself looks something like this:
If you’ve been following along you should have the know how to recreate this cutscene. As you can see here there’s going to be 2 shots here and the first shot is the one we’re going to use a dolly track on. The plan is to have the camera focus on Darren while the camera moves around the guard on the left all the while keeping Darren in the shot.
Let’s get started, click on the Cinemachine option at the top and this time choose the Create Dolly Camera with Track option. You’ll get a dolly track object along with a virtual camera object, go ahead and delete the virtual camera as we’re going to be using the one we have already.
Move the dolly track over to just behind where the leftmost guard is standing and then click on the add waypoint option in the inspector for the dolly track and you should see a green looking track connecting to points that are numbered 0 and 1. These two points mark the route that a camera will take while attached to the track. There’s also an adjustable tangent attached to each point that you can move about in order to curve the track.
Adjust the track until you’re happy and then click on your virtual camera that you want to move along the track. In the inspector for the camera you’ll notice a path property under the body option, go ahead and drag and drop your dolly track object into here and your camera will be set to move along the track.
Now it’s just the case of animating it in a similar fashion to when we were panning the cameras before. In the timeline create a new animation track and drag and drop the virtual camera into it and hit the record for the first frame. In the inspector for your camera you’ll see a Path Position property, make sure you set that to 0 which will move your camera to the start of the dolly track path.
You may need to adjust the camera here by rotating it to where you want the focus which for this case is Darren. Now move the timeline to just before the cut between shots and this time set the path position to 1 adjusting the camera if necessary. With that done you can set up a shot like this for whatever you’re working on:
Pretty good for a first look into it I’d say. There’s a lot more that can be done with this especially if you’re well versed in film techniques. The dolly track isn’t limited to two points in the path either, you can include as many as the shot needs!