Topic: Sound bug

Hello,

I have a problem with sounds, for example, i want to play a sound when theres a collision between objects.
All is working perfect except on collision, it looks like the sound is playing 50 times at once, resulting in a crazy noise.
I havn't found a script or option in the editor to make the sound only play 1 time so i guess its a bug ?

if not i'm sorry !

Re: Sound bug

The collision test is returning true when there is a collision, so since you objects are in collision you send a "playSound" order and the sound play from the beginning.

In script, you should do something like :




collision = 0

function onSceneUpdate()

    if isCollisionBetween(A, B) then
        if collision == 0 then
            playSound(sound)
        end
        collision = 1
    else
        collision = 0
    end

end

Re: Sound bug

That's working perfect, thanks smile