Hi,
Beginner programmer (not counting Commodore BASIC back in the '80s). Learning Godot with my son! I'm making my first game without a tutorial, a simple platformer similar to the '80s game Jumpman.
In the game, I have these gold pieces to pick up... it's an Area2D scene containing a sprite, a collision shape, and an AudioStreamPlayer named "bling" to play the pickup sound. But the sound won't play. Here's the entire script for the gold piece scene:
extends Area2D
onready var bling = get_node("bling")
func _on_Gold_body_entered(body):
bling.play()
queue_free()
The player is feeding the Master bus directly for now, so it shouldn't be an audio routing issue, and it plays just fine in the editor when I turn on "playing" in the inspector. In addition, the queue_free method activates just fine, so the function is definitely being triggered.
Any idea why it's not playing?
Thanks in advance for any light you can shed!
-Mark