3d sound doesnt seem to work properly in my FPS game. If i have the sound at a fixed position, it is always as loud whereever i go. As soon as i make the sound move along with the camera, it gets louder the moment i move closer to the 0,0,0 point of the map.
Steps i take:
First i set the position of the vector
[code:2jcd3pxl]channel.set3DAttributes(ref vec, ref vec2);[/code:2jcd3pxl]
Then i set the position of the listener
[code:2jcd3pxl]result = System.set3DListenerAttributes(0, ref pos, ref vel, ref front, ref up);[/code:2jcd3pxl]
After that, i update the soundsystem. I create the sound with the FMOD.MODE._3D option, like this
[code:2jcd3pxl]result = System.createSound(filename, FMOD.MODE._3D, ref sound.sound);[/code:2jcd3pxl]
Now, when i set the vector to set3DAttributes to 0,0,0, then the sound is always of the same volume. The vector i pass to set3DListenerAttributes is of the position of the camera. I have checked and it is in fact different. Let me show you:
[code:2jcd3pxl]11-08-2007 22:46:10 | Sound Position: 0 – 0 – 0
11-08-2007 22:46:10 | My position: 443,2504 – 222,1317 – 596,5914[/code:2jcd3pxl]
What could be the problem? Am i missing a step?
- grit asked 11 years ago
check your scale of units is in meters, and that the min/max distance is appropriate.
compare your code to the fmod 3d example and see what is different.
Make sure your up and forward vectors are perpendicular. They may not be correct and are failing.
Please login first to submit.