Adding Voice Over Instructions in Unity
Play an audio with the instructions when the player reach a part of the level
Objective: create a script to trigger an audio with the instructions when the player reach the collider.
First we have to create a new C# script called VoiceOverTrigger.
Then we have to add the script to the trigger game objects.
In the script declare an AudioClip variable and assign the clip in the inspector. Using the OntriggerEnter we are going to check for the player tag and check if the audio variable is not null and the last step is use the function AudioSource.PlayClipAtPoint() passing the audio clip and the position.
And that’s it!!! When Darren reaches the trigger the audio instructions are played.