Search Unity

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.