Unity Timelines

Hal Brooks
3 min readAug 10, 2021

Objective: Introduce Unity timeline to control cinematography for a cutscene.

Using timeline to switch between cameras and view in cutscene.

In the main scene of The Great Fleece add the Get_Card_Cutscene prefab to the hierarchy and name it Actors. Align the actors’ OfficeChair with the Sleeping_Guard game object then disable the sleeping guard by unchecking the box next to his name. Create an empty game object named Sleeping_Guard_Cutscene, positioned at (X 0, Y 0 and Z 0), and move the Actors into this new object. Use Cinemachine to create two virtual cameras named CM_OTS_Shot and CM_Mid_Shot. Create a new empty game object, naming it CM_Virtual_Cameras, also at (0,0,0). Child the two virtual cameras into the CM_Virtual_Cameras object. The hierarchy should be organized as shown below.

Organization for cutscene, noting CinemachineBrain icon on MainCamera.

Position the CM_OTS_Shot to appear as below, by using the scene view and pressing shift + ctrl + F with the virtual camera selected. This assigns the current scene view to the virtual camera.

CM_OTS_Shot perspective.

Similarly, position the CM_Mid_Shot to appear as below. You may need to select solo to see the virtual cameras view in the Game window.

CM_Mid_Shot perspective.

Add the Unity timeline from the menu window > sequencing > timeline. Select Sleeping_Guard_Cutscene and create a timeline named Sleeping_Guard_Timeline within a new folder Timeline in the Unity Assets folder. Add a new Cinemachine track using the + menu and assign the Main Camera with the CinemachineBrain to the track. Drag the two virtual cameras, CM_OTS_Shot and CM_Mid_Shot, into this track, as shown below, with a little overlap to provide a smooth transition.

Unity timeline controlling cutscene.

Add animation track, + menu, to the timeline and assign Actors to the track. This contains the GetCardAnimation. Add a second animation track and assign the CM_OTS_Shot. Now press the record button and select CM_OTS_Shot virtual camera in hierarchy. To assign a new animation point change the transform slightly then move the white slider to a new position. Shift the CM_OTS_Shot to above the shoulder of Darren, adjusting the camera rotation if desired, creating a pan camera effect. Stop recording and press preview play and the animation shown at the beginning of this article will play. The cutscene is beginning to take shape based on the directions provided in Unity timeline.

This article uses assets from The Great Fleece from GameDevJon on the Unity Asset Store.

--

--