How to Win the Race Using Director

Objective: Using Timeline, Cinemachine and sequenced character animations, let’s create a cutscene of a running race with the winning character raising their arms in victory and then limping off injured.

Winning the race cutscene

It’s time to have a little fun and create a running race scene using some of the concepts we have learnt so far. Along with the above objective, I will be using some Cinemachine cameras to capture the race itself and the winning moment.

The first Cinemachine camera will start from behind the runners using a Group Composer shot, followed by a blend into a Tracked Dolly camera that moves along besides them and finally a Composer ‘LookAt’ camera from behind the finish line to watch the race finish.

Scene Setup

Using some basic assets, I have been able to setup a running track field with some stadium seating, banners, fireworks explosion for the winner and of course the racers themselves, as seen below:

Scene setup

Timeline Setup

Here we have all the characters attached as an Animation Track which will play their running/movement animation.

I should point out that I haven’t needed to create a movement script because the imported animations from Mixamo have come with built in movement from the animation itself.

Creating the Winners Animation Sequence

As I know that the vampire character is going to win I have created an override track which has a ‘Raise Your Arms’ in the air Animation Clip so that it overrides the normal running animation.

Raise your arms animation clip overriding the running animation clip

Now, the override clip itself has full body movement but I didn’t want it to affect my characters running legs, I only wanted to apply the top half of the Animation Clip so I used an Avatar Mask to get this setup.

Raise Your Arms animation clip

Once the override clip has finished playing it will go back to the running animation, which then blends into the character limping off injured.

Using a Signal Emitter to Set Off the Fireworks

I have also used a Signal Emitter in the Timeline to trigger the fireworks particle effect when the winning runner crosses the finish line:

Emit Signal on Timeline
Fireworks Trigger script

Really basic script that just sets our array of confetti fireworks to be disabled at the start of the game.

Then the FireWorksOn() method is called from the Signal Receiver, after it has received the Emitted Signal:

Script and Signal Receiver attached to the banner game object

Cinemachine Cameras Setup

The first camera has been setup as a Group Composer to make sure that all the runners were staying in the shot. It was also setup to be behind the runners at the start to capture that moment before blending into camera two. The Group Composer only uses a ‘LookAttarget, and no ‘Follow Target’.

The second camera is setup as a Tracked Dolly camera that moves alongside the runners to help capture the winning runner put their hands up in the air, which then blends into the third camera as they are coming across the finish line. This needs both a ‘Follow’ and ‘LookAttarget to build this.

The third camera was setup as a Composer ‘LookAt’ target only to capture the fireworks animation as the winning runner comes over the finish line and then to watch them limp off injured after the race.

--

--

--

Passionate Unity Game Developer

Love podcasts or audiobooks? Learn on the go with our new app.

Recommended from Medium

Freshworks Neo comes to simplify your customizations

Everything Wrong With Facial Recognition Software and 3 Essential Ethical Considerations That Must…

334. Increasing Triplet Subsequence

Data Pipelines: Scaling a Message Broker System for Half the Cost

Tips to Improve MySQL Query Performance

Spring Security 5, Resource Server

“Meeting Culture” for Software Engineers

Synchronising Automation of browser testing — Browser Sync and Selenium

Get the Medium app

A button that says 'Download on the App Store', and if clicked it will lead you to the iOS App store
A button that says 'Get it on, Google Play', and if clicked it will lead you to the Google Play store
Chris Hilton

Chris Hilton

Passionate Unity Game Developer

More from Medium

Importing Character Models and Animations from Mixamo into Unity

Working with Screen Space Reflections in Unity’s HDRP

Loading Scenes In Unity

Unity : Raycast (Part III)