Combining Cinemachine and Timeline to Open a Treasure Chest in Unity

Chris Hilton
3 min readMar 1, 2022

Objective: To combine both Cinemachine and Timeline to create a cinematic opening of a treasure chest.

Cinemachine Track combined with a Timeline Sequence

I have recently posted a couple days ago the article the showed how to open a treasure chest using Timeline. Well this one is going to be super quick and show you how to incorporate Cinemachine to give it that added cinematic touch.

Existing Scene

Using the existing scene I have already setup:

Treasure chest opening with a weapon coming out and particle effect using Timeline

Let’s add a Cinemachine camera to our existing Timeline that is going to be used to zoom in on the treasure chest when it is opened, and zoom back out once it’s closing.

Adding Cinemachine Camera to Scene

Head to the Cinemachine tab → Add Virtual Camera.

Adjust the ‘Field of View’ option in the Inspector so it looks something like this:

Virtual Camera — Field of View ‘33'

Add Cinemachine Virtual Camera to Timeline

Let’s now drag and drop this Cinemachine Virtual Camera game object into the existing Timeline, and let’s choose ‘Add Clip With Cinemachine Track’:

Drag and drop Cinemachine Virtual Camera into Timeline

The Cinemachine Track is also looking for a Cinemachine Brain, so make sure to drag your game object into this field — more than likely this will/should be sitting on your Main Camera game object. Look for this symbol in your Hierarchy:

Dragging and dropping the Cinemachine Brain into the Cinemachine Track field

It’s That Simple! Let’s Test it Out!

Cinemachine Track combined with a Timeline Sequence

It’s a little bit rough around the edges and I don’t quite like how sharply it cuts to the Cinemachine Track so let’s add some Ease In/Out to the track:

Adding some Ease In/Out to the Cinemachine Track

Let’s Try Again!

Cinemachine Track combined with a Timeline Sequence

Much Better!!!

--

--