This has been driving me crazy for ages and I've not found any solution. Simply put, I have a mechanic in my 2d game where you must shake the mouse side to side to "shake off" an enemy, and to do this I have 2 rectangles on either side of the screen that check if the mouse is over them and adds to a "total mash count" variable. It plays a sound whenever the mouse enters one of them (only once and so does the variable increment) per "mouse enter". For some reason, after this encounter stops, all my other sound effects never play again like closing a door or entering a locker. It's a very small simple game.I’ve tried messing with busses, polyphony limit, etc. Nothing works.
func _on_left_door_button_button_down() → void:
soundplayer.stream = load(“res://Sounds/doorclose.wav”)
soundplayer.play()
leftDoor = true
officeStates()
print("left door is " , leftDoor)
This is my code for handling the door and its sound. I use the same audiostream for both the door and locker shutting/entering sound
func _on_mash_left_mouse_entered() → void:
if snakeAppeared and not dead:
mashSound.play()
snakeMashCount += 1
print(snakeMashCount)
This is my code for handling one of the mashing rectangles. It’s the same for the one on the right. Again, after this encounter finishes, all other sounds like the door and locker are basically muted and never play again unless i restart the game. The mashing sound is on its own bus.
Please format the code properly as preformatted text with triple backtick ``` at the beginning and end of the snippet. Otherwise, as you can see, it flattens and is hard to read.
Soundplayer and mash sound are 2 different stream players. The sound player is connected to a bus with reverb effect. Again to clarify, after the mashing sequence concludes I no longer hear my door and locker sounds. The code still executes (like the doors shutting/opening) but the sound just stops playing. The game does not pause either. And again simply playing the sounds for the door, locker and mashing feedback is the only code for them.