Search Unity

  1. Megacity Metro Demo now available. Download now.
    Dismiss Notice
  2. Unity support for visionOS is now available. Learn more in our blog post.
    Dismiss Notice

Audio Can audio source spatial blend / distance be square?

Discussion in 'Audio & Video' started by DevilCult, May 3, 2019.

  1. DevilCult

    DevilCult

    Joined:
    Jun 24, 2017
    Posts:
    62
    Hello guys, i'm making a 2D game with a tiled terrain that have water.
    What i want is when my character get near the ocean that it start spatial blending but without that circle distance, i need a square distance.

    I've been searching for quite a bit. Any way to achieve this? I could probably set a box collider trigger and calculate distance from center of the collider to border then raise the volume of the audio mixer according to where the character is positioned but wondering if there is a more easy way to do this?
     
  2. Docaroo

    Docaroo

    Joined:
    Nov 7, 2017
    Posts:
    82
    What we do is we have a "bezier curve path" that can be drawn in the editor and the AudioSource position gets fixed to that path...

    Then the AudioSource position is matched to the audiolistener postion along the path.

    There's an asset on the asset store that can do this too called "Volumetric Audio".