Search Unity

  1. If you have experience with import & exporting custom (.unitypackage) packages, please help complete a survey (open until May 15, 2024).
    Dismiss Notice
  2. Unity 6 Preview is now available. To find out what's new, have a look at our Unity 6 Preview blog post.
    Dismiss Notice

Question Overlapping moving music proximity problem

Discussion in 'Scripting' started by SeymourGutz, Oct 8, 2020.

  1. SeymourGutz

    SeymourGutz

    Joined:
    Aug 9, 2019
    Posts:
    16
    Google is only providing totally unrelated answers so turning here for help.

    In my 3D scene:
    There is a non-moving audio source playing music in a specific area radius.
    There is also an audio source playing music attached to a roaming AI boss.
    The problem is if the boss wanders into the area music zone, both overlap.

    Please share the simplest solution that will disable or preferably gently fade out the area music when boss enters range, then re-enable the area music again whenever he leaves.
     
  2. Xarbrough

    Xarbrough

    Joined:
    Dec 11, 2014
    Posts:
    1,188
    Probably audio mixer snapshots. One snapshot for the boss music, one snapshot for the regular tracks. When the boss enters a trigger area, trigger a snapshot transition (it has a fade duration and other settings).

    See this Unity tutorial.