- Home /
How can I make the AI jet have 3D sound?
I'm working on a game which uses the AI jet from Unity's Standard Assets, but I find that the sounds (jet engine & flight wind) are not being handled as 3d, so no Doppler effect, no volume roll-off, just a constant level all the time, regardless of player's proximity to the jet. The AeroplaneAudio.cs doesn't provide an option for 3D sound, and I don't know how to code one in.
I tried creating an empty game object, adding an audio source component, adding a simple script to play the jet sound, and made that game object a child of the AI jet... this gave me a Doppler effect, but it bore no relation to my proximity to the jet, and the volume level was still constant regardless of proximity.
I wonder if I'm just missing something simple that isn't obvious to this relative noob...
If anyone could lend me a clue, that would be greatly appreciated, since at present, I am entirely without clue.
Answer by GKuhns · Feb 14, 2017 at 09:39 PM
OK, I found a solution.
I created an empty GameObject, attached it o the AI Jet, gave it an audio source, assigned the jet sound, set spatial blend to 3d, (leave Doppler level at 1) - but the key turns out to be changing the volume rolloff from Logorythmic Rolloff to Linear Rolloff.
Now I have a working 3d jet sound. hooray. On to the next challenge.
Answer by PixelSpartan · Feb 14, 2017 at 04:37 PM
Find the jet's AudioSource component and go to "doppler" and slide it all the way to the right (says 3d below the slider)
Every time you add a audio source component for some reason the doppler slider is always set to 2D, so you always have to slide it if you are making 3d games