![]() |
Attention | Topic was automatically imported from the old Question2Answer platform. |
![]() |
Asked By | korayozbay |
Hello,
I am new to Godot and I want an object to play a simple sound before disappearing. So I added an AudioStreamPlayer node to my object, dragged and dropped a wav file to the Stream box. I wrote the following code but it doesn’t play. Any ideas?
func _on_block_brk_1_input_event(viewport: Node, event: InputEvent, shape_idx: int) -> void:
#print("Any input event")
if event is InputEventMouseButton:
if event.is_pressed():
print("Object clicked")
$AudioStreamPlayer.play()
queue_free()