Godot Version 4.4.1
Question
Probably a total beginner question: I’d like to play a sound (coming from my player) when I hit a key on the keyboard. I already placed an AudioStreamPlayer2D on my Player node and assigned a key-bind in the Project Settings but I have no clue how to go about code-wise.
I tried setting up a function with an if-statement and action_is_pressed(“yolo”) but all I got was error messages. It seems pretty simple on paper.
Could anybody point me in some direction that is helpful, please?
Thanks for your time!