Hi, im making platformer game where you pick up things. I wanted to add sound effect for picking up coin but it doesnt seem to work, so ive tryied it on another object and it works. When picking up coin i can hear some quiet noise.
i use play() function, playing and autoplay is turned off
Are you using an AudioStreamPlayer3D by any chance?
AudioStreamPlayer3D
No, im using AudioStreamPlayer2d. Thats confusing because on other objects it works properly. code for pick up funcion of coin : func pick_up(): $Sprite.self_modulate.a -= .075 if $Sprite.self_modulate.a <= 0: queue_free() $weed.play() position.y -= 1
@olokolo96 said: No, im using AudioStreamPlayer2d. Thats confusing because on other objects it works properly. code for pick up funcion of coin : func pick_up(): $Sprite.self_modulate.a -= .075 if $Sprite.self_modulate.a <= 0: queue_free() $weed.play() position.y -= 1 weed is my sound node xD
I've realized what is cause of this. The sound just wasn have time to play bevore the parent node was deleted.