I am making a simple platform game, and trying to add sound effects. I downloaded some as .wav files, and have each attached to an AudioStreamPlayer2D. How would I activate these when I hit a certain object? Here is an example below:
elif object.isingroup("killzn"):
*** INSERT SOUND ACTIVATION HERE ***
# Respawn
score = 0;
update_score();
#print(self.name + " has died.")
respawn();
velocity = Vector2(0, 0);
continue;