Search Unity

  1. Unity 2019.1 is now released.
    Dismiss Notice

Audio Resonance and Unity Audio together

Discussion in 'Audio & Video' started by Piroooz, May 19, 2019.

  1. Piroooz

    Piroooz

    Joined:
    May 19, 2019
    Posts:
    3
    Hi!

    So I'm using Unity's audio engine to set up a simple level where a voice line is triggered every time the player interacts with one of 14 objects, as well as a layer of music being brought in simultaneously (using the script below). I want to add resonance to my project to have spatialised sounds as well as what I already have using unity's mixers/audio engine without it replacing them. Is that possible/simple?

    Currently having quite a few issues trying to get it to work!

    Thanks a lot, Pirooz

    Code (CSharp):
    1. public class PlayLayer : MonoBehaviour
    2. {
    3.     public AudioSource audioclip;
    4.     public GameObject trigger;
    5.  
    6.     void OnTriggerEnter(Collider collider)
    7.     {
    8.         if (collider.tag == "Player")
    9.         {
    10.             trigger.SetActive(true);
    11.             audioclip.volume = 0.3f;
    12.         }
    13.     }
    14. }