Search Unity

  1. Welcome to the Unity Forums! Please take the time to read our Code of Conduct to familiarize yourself with the forum rules and how to post constructively.
  2. We have updated the language to the Editor Terms based on feedback from our employees and community. Learn more.
    Dismiss Notice
  3. Join us on November 16th, 2023, between 1 pm and 9 pm CET for Ask the Experts Online on Discord and on Unity Discussions.
    Dismiss Notice

Changing audio Spacial Blend via script.

Discussion in 'Scripting' started by dijital, Oct 20, 2015.

  1. dijital

    dijital

    Joined:
    Apr 28, 2010
    Posts:
    232
    Hi,

    I've upgraded my project from unity 4 to 5 and I can't work out how to set the audio sources spacial blend in via scripting.

    My audio sources are set dynamically at runtime, so I will have no idea which audio source will be 2D or 3D. I will need to set the spacial blend every time the audio clip is called in a script. I can't work out how to do it.

    Any ideas?

    Thanks in advance!
     
  2. vintar

    vintar

    Joined:
    Sep 18, 2014
    Posts:
    90
    isn't it the audio CLIP that will be 3D or 2D and not the source?
     
  3. dijital

    dijital

    Joined:
    Apr 28, 2010
    Posts:
    232
    That's what it used to be like until Unity5 ruined it.