Music Playing but Sound Effects wont

Been following the tutorial and have the background music playing just fine. for some reason though it wont play the sfx(jump) at all. I’ve tried doing it directly from the player node as well as through the AudioPlayer as per tutorial. As far as I can tell I’m doing it correctly, but no matter what I try, I get get it to play the jump noise.

Can you post your relevant code? Not much we can do otherwise.

extends Node2D

var hurt = preload("res://assets/audio/hurt.wav")
var jump = preload("res://assets/audio/jump.wav")

func play_sfx(sfx_name: String):
	var stream = null
	if sfx_name == "hurt":
		stream = hurt
	elif sfx_name == "jump":
		stream = jump
		print("Invalid SFX Name")
	var asp = = stream = "SFX"
func jump(force):
	velocity.y = -force

fixed the second “” to be “” jump sounds will play now.

1 Like

Good job! You spotted it just before I did XD

1 Like

This topic was automatically closed 24 hours after the last reply. New replies are no longer allowed.

Privacy & Terms