Search Unity

[audio] Making a minor adjustment to the Reaction Collection/interactable script in Adventure Game

Discussion in 'Community Learning & Teaching' started by Krang, Mar 13, 2018.

  1. Krang

    Krang

    Joined:
    May 3, 2017
    Posts:
    1
    I'm currently doing a project to replace the audio in the Adventure Game tutorial and instead use audio from Wwise. Basically, wwise adds new components which refer to audio within the wwise software. So it's pretty easy to attach sounds by simply adding wwise components to unity game objects.

    One thing i'm having an issue is that I want certain audio events (via the wwise components) to trigger after the player interacts with them. So I can't simply add components to objects, I need to change some scripts and I'm having some difficulty doing so.

    Example: In the SecurityRoom Scene I can see that this is originally done by having the interactable script attached to an object like "DoorToMarketInteractable". Within this object is another object called "DefaultReaction" which contains a "ReactionCollection" script.

    This then references a "SceneReaction" Script ( which changes between scenes when the reaction occurs) and an "AudioReaction" Script, which would normally reference the audio you want to trigger from this interaction.

    I want to change the "AudioReaciton" script to instead trigger one of the wwise components attached to that object. So far, i've managed to work out that the script essentially needs these functions:

    using UnityEngine;
    public class AudioReaction : Reaction
    {
    protected override void ImmediateReaction()
    {
    }
    }

    what could I add to this whch would trigger the specific Akambient component attached to the object?


    Thanks