Changing audio Spacial Blend via script.

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!

isn’t it the audio CLIP that will be 3D or 2D and not the source?

That’s what it used to be like until Unity5 ruined it.