Coin pickup audio help

Hello, I am trying to resolve the problem where if I pick up a coin from its left side the audio only plays in my left headphone, and if I approach it from the right side it only plays in my right headphone. If I jump straight up vertically to collect a coin it plays equally in both headphones. Is there any way to make the audio play in both headphones equally all the time? I followed what Rick did and did not deviate.

Check your Audio Source’s “Spatial Blend” setting. Is it at 2D or 3D?

Hi Phil,

Welcome to our community! :slight_smile:

Do you call PlayClipAtPoint? If so, pass on the position of the camera to that method.

If you instantiate a prefab with an AudioSource component at the position of the coin, set the Spatial Blend in the AudioSource component in the prefab to 2D.

Hi Nina, thanks for your reply. Here are screenshots of my code and audio source.


I did find out that if I disable the Cinemachine Brain component on my main camera then the audio plays correctly in both headphones equally. I can’t seem to find any setting on that component or on the virtual cameras that relate to audio though.

Hi Michael, it is set to 2D on my coin but when i use PlayClipAtPoint the instantiated object has the audio source set to 3D. I am instantiating it to the cameras position which should be resolving the problem.

Does that mean you fixed the problem? Or does that mean you did that but the issue persists?

Hi Nina, I have not fixed the problem that is what I am already doing.

How are you getting on with this?

If you still need help, have you already tested different headphones? And is the AudioListener assigned to the camera?

Hi Nina, yes I tried my speakers and different headphones with the same results. I have found work arounds to get the audio working correctly. The only way I can find to reproduce the problem is to use AudioSource.PlayClipAtPoint and have the CinemachineBrain component on the camera along with the audio listener. If I move the audio listener onto an empty gameobject which does not move in the scene, the audio plays correctly. Or if I use PlayOneShot instead of PlayClipAtPoint while leaving the audio listener on the camera with the CinemachineBrain, the audio will play correctly. I have tried googling the problem but nothing has worked to get the CinemachineBrain and PlayClipAtPoint to work together properly. I hope that all made sense :slight_smile: Thanks for your help.

Since you mentioned the ConemachineBrain, the issue makes a bit more sense. The AudioListener has to be assigned to the rendering/active camera. And you have to call PlayClipAtPoint with the coordinates of the game object with the AudioListener. Only then you will not have any 3D sound effect.

However, if that does not work, there is a chance that the cinemachine is a bit buggy and messes around with the AudioSource object.

Yes I have tried putting the AudioListener on the rendering/active camera, but as long as the CinemachineBrain is enabled on it I still have audio issues. I guess it must just be some bug. It’s o.k to close this as I have a couple work arounds. Thanks for your help.

This topic was automatically closed 24 hours after the last reply. New replies are no longer allowed.

Privacy & Terms