- Home /
How to do 2d audio properly?
I cant figure out or find any tutorials on how to do 2d audio properly. Like have a audio source fade out when your not near it and fade in when you are. I've tried using spatial blend on the audio source but it only works a little bit.
$$anonymous$$ake sure your listener is moving with the player (its usually attached to the camera by default). If it isn't, that might explain why it's only working a little bit.
Answer by FreeReignPublishing · Apr 25, 2019 at 06:47 AM
Hi, @devPhil I already have a listener attached to the main camera. Any other ideas why? Thanks so much!
Unless your camera position is exactly the same as the playable character you should attach it to the player character. I'm not sure what you're game looks like but if you have the listener attached to your camera then you won't get the effect you're after because there will always be a relatively large distance between your audio sources and the camera/audio listener making what you are trying to do a little harder. Let me know how you go :)
Your answer
Follow this Question
Related Questions
Play Sound on Destroy 1 Answer
Play Sound on Destroy 1 Answer
Attach audio source to different part of object 0 Answers
Make Sound Effects Not Audible Unless Near Them 2d? 1 Answer
Is there a way to create a random Audiosource loop? 2 Answers