Godot Version
4.2.1
Question
Hi, I’m just starting out with programming and working on a flappy bird clone with the help of some tutorials. I want to add my own sounds with SFXR so im using the Godot Plugin for it but no matter what I do I cannot target the SfxrStreamPlayer Node.
The scene is set up like this :
Bird
PointLight2D
CollisionShape2D
Sprite2D
Area2D
CollisionShape2D
SfxrStreamPlayer
The script is in the root node “Bird”
and I want to play the stream from SfxrStreamPlayer but when I try to target the node with $SfxrStreamPlayer. or get_node(“SfxrStreamPlayer”) it returns <Object#null>, despite everything working when targeting a different node.
here is the function for when I am trying to play the sound :
func _process(delta):
velocity.y += gravity * delta
if Input.is_action_just_pressed("Flap"):
velocity.y = -400
$SfxrStreamPlayer.play()
move_and_slide()
#Wasnt sure how to insert the boxes with code