Voiceover Event Calls in Unity

Previously, all voiceover calls in our game were being called independently on either trigger objects, or from the Timeline editor in our cutscenes. Much like the Music system discussed here, I wanted to make a more modular system.

In Wwise, I have a selection of different SFX Objects containing each Voiceover sound, with corresponding Events. One of these, is actually a Random Container, that allows for different variations to be played for the same Event.

Over in Unity, within our Audio Manager Script, we have a public method that receives a Wwise Event type variable, then simply Posts it.

To call this, we can create a VOTrigger Script, much like our Music System, we can create different bools to discern how each Voiceover is to be called. The difference here, being that we select an Event as opposed to a Switch.

Now, for each possibility, we can check the bool, then call our Audio Manager’s method.

With use of Colliders, we can easily create Trigger areas in Unity, select the correct bool and Event, and we have a working Voiceover system.

For Voiceovers within Cutscenes, we can instead use the OnStart bool, and attach the script to that game object.

Taking things further, we can also skip our Voiceover Event. Some cutscenes are skippable, and we need the Voiceover to follow suit.

This script, can be added to our cutscene object, and simply grab a reference to the Playable Director so we can then grab the total time of the cutscene, and set the current time to be at the end.

In terms of the audio, if we look back at our VOTrigger script, you may notice the Event is an Internal type variable. This acts similarly to a private variable but can be accessed from scripts on the same game object. Now within our SkipCutscene script, we can get a reference to what the called voiceover Event is, and pass it on to our Audio Manager.

Within our Audio Manager, we can then call the Stop function on this particular Event.

--

--

--

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

Recommended from Medium

Reversing a singly linked list of n elements in group of k (k-reverse a linked list)— Coding…

Setting up a Blockchain Business Network With Hyperledger Fabric & Composer Running in Multiple…

Python Tuple with best Examples

C Program to check whether a number is prime or not

Creating a Boss Enemy — Part 2, Boss Projectiles

FaunaDB: An Introduction

The journey so far: 19 year old full stack web developer

Why test automation is crucial for Oracle Cloud testing?

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
Calum Slee

Calum Slee

More from Medium

Horse to Muscle to Bone Animation

Switch Statements to the Rescue

Building a Modular Ducking System

Creating An Advanced 2D Player Controller Without Any Unity Components! (Part 5)