Building in the cutscenes
Now that we set up our singleton to let Unity know we have gone through the procedure to get the keycard from the guard, we can now look at getting our final 2 cutscenes built into the game.
To start, we will need to attach a new script to the collider zones that are in place so that we can designate which cutscene we would like to play when we reach the area:
As for the coding within the actual script, with our win activation, we need to make sure that we have the card before we can play that one, while with our sleeping guard cutscene, we just need to trigger the activation of it. When we try to play our scene as it is, we will hit a snag with the sleeping guard:
This occurs because we are currently looking through the lens of our 2nd camera shot. To solve this, we are simply going to create a new camera angle at the end of our cinematic after it has faded our to transition to a better angle:
On top of this addition, we can make a few new activation track additions:
The last part for this cutscene we need to make a quick change to our playable director:
Under wrap mode, we need to set it to none so that we can properly interact with our nav mesh agent. If we don’t, what will happen is that our player will not properly move to the locations that we click onto.
We have moved our cutscene into the holder so that we can deactivate the cutscene upon the end of it, preventing the actors in the cutscene to stick around in the game. We have our sleeping guard and player showing up within the end of the cutscene so that they don’t overlap our in game assets with the cinematic assets. We have a 2nd activation track for the card, as this one is for the guard that is actually in the game, and not just the cutscene, as they are 2 different objects in our game.
With all of this in place, we can now move towards getting our final cutscene working proper. This one will have some similarities to our game over cutscene, as we do not go back into our game once it is over.