Search Unity

  1. Get all the Unite Berlin 2018 news on the blog.
    Dismiss Notice
  2. Unity 2018.2 has arrived! Read about it here.
    Dismiss Notice
  3. We're looking for your feedback on the platforms you use and how you use them. Let us know!
    Dismiss Notice
  4. The Unity Pro & Visual Studio Professional Bundle gives you the tools you need to develop faster & collaborate more efficiently. Learn more.
    Dismiss Notice
  5. Improve your Unity skills with a certified instructor in a private, interactive classroom. Learn more.
    Dismiss Notice
  6. ARCore is out of developer preview! Read about it here.
    Dismiss Notice
  7. 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
  8. 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

    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