Hi,
I have a sound that takes about 1 second to finish, for a machine gun fire sound. Badaboooom!
But sometimes, the user will shoot more than once per second. Bada-bada-bada-bada-badaboooom!
Okay, so right now, when they shoot the second time, it replays the firing sound from the start. What’s the best way to make this work, so the sound overlaps, and doesn’t just start over?
It’s a machine gun with no actual projectiles, so I can’t just add a sound effect to the bullet and have it play on start.
Should I create an empty object, add the sound to that and a timed destroy, and instantiate a bunch of those?
Or is there some other trick I don’t know about?
Thanks!
-Chilton
I came up with a reasonable solution a while back.
I took a sound of a machine gun. Generally it was the start of the gun shooting, this gun shooting and the gun stopping shooting. These three portions were in the original sound file.
What I did was take the three sections, keeping mind the middle sound (the gun firing… badda-badda-badda…) I kept short to the length of the time between bullet n and bullet n + 1. So however long the length of time between bullets firing I made the length of the looping, middle sound.
So, overall, my process was… use three sounds, each sound a section made up from one sound file. Player hits fire, play start firing sound once. Player holds fire down, loop mid sound, badda badda file. Player releases fire, play fire end sound.
2 Likes
Clever, clever. I will give that a shot.
1 Like
Even choose two or three sections for the middle loop for variance.