The question is answered, right answer was accepted
Play sound within limited region
Basically for my game I want to play sound say 5 units region. I have placed series of cannon at certain distance as per my game play. So I want to hear only nearest cannon fire sound and at present I am getting all tanks fire sound simultaneously.
I googled for this thing and at present I have this kind of inspector.
Please give me some suggestion for this.
Answer by Le-Pampelmuse · Mar 17, 2016 at 12:20 PM
You didn't set your Spatial Blend to 3D.
If you set it to 2D, no distance settings are applied.
It will always be at the same volume in every channel.
For this, you are right. I got some sort of distance detection now.
Answer by SeasiaInfotechind · Mar 17, 2016 at 11:50 AM
Hi, Have you tried playing sound using AudioSource.PlayClipAtPoint. You need to manage with in script when sound should play for each cannon. This might solve your problem
Using AudioSource.PlayClipAtPoint does not playing any sound and I don't know why. But I think AudioSource.PlayClipAtPoint can't able to solve my problem because I need distance based updation in sound.
Follow this Question
Related Questions
Second AudioClip won't play 0 Answers
Second AudioClip won't play 0 Answers
How to fix Multiple Gun firing sounds that play even when i switch weapons 0 Answers
Some sounds won't play 0 Answers