Hello, I've created an SFXEmitter but when setting volume via a custom ImGui UI, it doesn't work. If I look in the editor, the volume is changing but it's not actually updating it. Where I'm creating the object Code: -- create sound local soundObj = getObject("rain_sound") if not soundObj then soundObj = createObject("SFXEmitter") soundObj.scale = Point3F(100, 100, 100) soundObj.fileName = String('/art/sound/environment/amb_rain_medium.ogg') soundObj.playOnAdd = true soundObj.isLooping = true soundObj.volume = 0 soundObj.isStreaming = true soundObj.is3D = false soundObj:registerObject('rain_sound') end Where I'm updating the volume Code: if imgui.SliderFloat("Rain Volume", ptr_rain_volume, 0, 1, "%.2f") then soundObj.volume = ptr_rain_volume[0] end Any help would be appreciated
Unfortunately sound emitter values can't be updated in real time, the sound always needs to be restarted. Sound emitters are not meant to be dynamic objects, apparently. To update, first stop the sound and then play it again: Code: soundObj:stop() soundObj:play()
I've already tried that, sadly it didn't work. For my server on KissMP, I had to fully delete it and then make a new one. I suppose I'll be doing that again