So I am trying to create a platformer and decided to add a sound that plays when the player falls on a platform. This is the code I used:
if move_and_collide(direction.normalized()):
$AudioStreamPlayer.play()
The only problem is that the sound loops unnecessarily every frame there is a collision. I would like to know if anyone knows how to make it play once. Apologies for my amateur coding and amateur coding knowlegde.
Cheers,
-Drunko