Search Unity

  1. We want you to join us at GDC this year! We've added new sessions to Unity Central, space is limited so sign up now!
    Dismiss Notice
  2. Magic Leap’s Lumin SDK Technical Preview for Unity lets you get started creating content for Magic Leap One™. Find more information on our blog!
    Dismiss Notice
  3. Unity 2017.3 has arrived! Read about it here.
    Dismiss Notice
  4. ARCore is out of developer preview! Read about it here.
    Dismiss Notice
  5. Tell us about your experience here and you’ll get early access to the 2018 Game Studios report + more goodies.
    Dismiss Notice
  6. Be the first to take a peek at upcoming 2D Animation Preview. Drop into the forum and check it out!
    Dismiss Notice
  7. Want to see the most recent patch releases? Take a peek at the patch release page.
    Dismiss Notice

[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


    May 3, 2017
    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?