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.
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.
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:
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.
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.
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:
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:
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 ‘LookAt’ target, 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 ‘LookAt’ target 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.