In-game cutscene Unity Free

I’m trying to make a cutscene in my game by triggering animations at certain points in the scene. I want the player to maintain control while the NPC talks to them. I want it to be similar to scenes in Half Life where the characters talk through a script while Gordon runs around hitting things with his crow bar. This should be a real simple task to just trigger animations and audio sources, but I seem to be having some trouble.

Don’t have the files with me as I’m at work, but I’ll upload a sample of what I’m trying later. Thanks for the help in advanced!

EDIT: I think what I need help with is calling the different animations on the same object based on events.

So here is how the cutscene works.

You start the scene in a helicopter that flys through the city and lands on a pad at an apartment. The camera switches to the player after a certain number of seconds (the length of the helicopter camera flying through the scene).

The player goes inside the apartment by opening the door with E which will trigger the sound of the NPC inviting him inside.

When the player is in, the NPC asks him to take a seat on the couch while he puts on some music. (Player approaches couch and presses E to trigger a sitting animation).

While the player is seated, the NPC offers him a smoke and tells a little bit of back story to the player.

After that bit of dialogue, more NPCs will storm the house and murder the first NPC.

The player then goes to the window and presses E to play an animation of him jumping out the window which brings the player to the first level’s scene.

Here is a script similar to the one I have on the couch that isn’t working how I intend it to. I have references to the player - to play the sitting animation - and the NPC - to play the dialogue.

var player: GameObject;
var cheetah: GameObject;

function OnTriggerEnter () {
if (Input.GetKeyDown(“E”)) {
player.gameObject.GetComponent(“FirstPersonDrifter.cs”).enabled = false;



Maybe some more details would help identify the bits you need help with. It depends on the complexity of the cutscene and the events you require to move the cutscene on (for example looking at an object, talking to someone or pressing a button) but I would suggest looking into Finite State Machines (FSM). Each state could contain audio/animations. Trigger colliders, the end of the audio/animation or player events can transition to a new state. I hope that helps =)