This is my Metasound graph for my gun sound.
I call the start trigger when left click is pressed and the stop trigger when left click is released however, if I press left click really fast so that the start and stop triggers are called on the same frame no sound is played. I want the sound to play but also not play anymore after that frame. How can I fix this? This is for a gun that fire 10 times per second so it doesnt play the sound quite often when spamming left click but I cannot have this in the final game. Are there any easy ways around this?
The code that handles firing logic should be calling the execution of the sound. Not an Input. Each time the weapon actually fires you execute the playing of the sound. This way you aren’t playing audio when the weapon can’t fire (out of ammo etc).
For rapid firing I have the audio in two pieces. Frontend and backend (tail). During fast repetition the tail is never played, only the frontend. The last shot gets the tail applied.
This is what I actually do. StartFire and StopFire are called when left click is pressed and released. It then checks if it can fire and if it can, it starts the audio. The problem is when I call StartFire then StopFire really fast, it instantly stops the audio as it starts.
This is the audio graph that just repeats a sound 10 times per second to copy the guns fire rate. I tried just delaying the stop trigger so it stops the audio after one shot but then two shots are fired if held too long.