[Solved] 3D sound issue

ies

ies

Level 3
Joined
Jun 11, 2019
Messages
15
Hello, I'm making a custom teleport to base and it has been rocky but I've ironed out all but this sound behaviour.

When successfully channeled, I set the player's cam position and then play 3D sound on unit that moved there.
But the sound will not play, unless the camera was in range for the sound before this block. I might be misunderstanding how 3D sounds work, but I thought the camera position was what determined whether or not the sound should play.
Do I need to add some delay?

Also, what are the 2 values on SetSoundDistances exactly doing?
 
Level 23
Joined
Dec 4, 2007
Messages
1,554
You can try to play on location rather than on unit.
The sound is playing otherwise and set correctly (i.e. mono channel and .wav format)?

The distance settings determine when the sound starts to fade, but i'm not even sure they are working.
 
Level 30
Joined
Aug 29, 2012
Messages
1,382
What parameters did you input in your sound variable? It's good practice to stick to default Blizzard values I'd say, something like this

1722849978293.png


A wrong channel can cause sounds to just go silent too
 

ies

ies

Level 3
Joined
Jun 11, 2019
Messages
15
12345689.PNG

Here is the init, there is no problem with the sound itself, it will play if I manually move camera to the point where it should play.
The problem is I am moving the camera in code and then playing the sound(ref 1st image) which does not work; I tried playing from location instead with the same result.

e: solved by adding a delay through timer, it appears the game needs some time for its internal checks on player's camera position.
 
Last edited:
Top