Hello everyone. I tried hard to find the solution myself, but that turned out into a great problem. What’s the point: i just want to put several audioSources throughout my scene and make them interact as 3d. So if I come closer and enter the maximum zone - the sound plays. If I go out - it stops. Pretty decent and quite obvious.
But that just doesn’t work! I really manipulated every setting and option that AudioSource has, switched spacial blend to 3d, played with different types of volume rolloff. Nothing!
May be the key is in the very audio file? Should we convert it somehow or use only specific format?
I can’t see how the audio file would be an issue. Where is your Audio Listener placed? If it is static and doesn’t move, then you should expect to hear any fluctuation in your audio levels. Could that be the problem?
1 Like
Oh, god. I didn’t even think this way. Audio Listener was attached to fps camera prefab. I just put it to a static object and everything works. Thanks!
Hm, that works only in the editor if I hit the sound icon. In game mode the sound plays very loud everywhere.
It should work Ok if it is attached to a fps camera. My point was that the Audio Listener should not be in a static object that doesn’t move. So it works in edit mode but not in game mode. It should be clear to see what’s happening if you run in game mode, but view the scene in the editor. Take a look at things in there and make sure everything is behaving as expected. It’s often difficult to tell in when viewing in game mode.
I think it was some sort of bug. I removed all listeners from the scene, reopened the editor, attached one to the camera - and volia - everything works. Strange, but at least useful. Thanks once again!