Hello! Have problems with this. Dunno how to turn off the sound → setListenerPosition. It’s UI or background music
update() {
this.sound.setListenerPosition(player.x, player.y);
}
setListenerPosition effects all music in game. I need to disable it for background music but cant see the way how to do it. Any help appreciated! TYSM!
1 Like
samme
May 22, 2024, 7:36pm
2
It’s not possible to set the listener position per sound.
oh i see! thanks for ur answer! have a nice day!
So i should choose either background music or spatial Audio looks like?
found the way! hope this can help someone! the sound should goes as
this
.
backgroundMusic
new
Audio
(
‘path/to/background-music.mp3’
);
this
.
backgroundMusic
.
loop
true
;
this
.
backgroundMusic
.
volume
= 0.5;
this.backgroundMusic.play();