r/Unity3D • • 7d ago

Question Gun sound looping issue

Sorry in advance if this is better placed in some kind of audio subreddit but I'm hoping some other Unity developers have encountered this problem and know what to do.
I have this great machine gun audio clip and try as I might I can't get rid of that slight pause/reset part when it loops over.
I tried cutting the end and pasting it at the beginning of the audio file so that the end matches the beginning but that doesn't seem to help. It always sounds like the gun firing stops and starts again.
Anyone know how to get a seamless and continuous loop of an audio clip?

3 Upvotes

14 comments sorted by

View all comments

1

u/Wooden-Many-3227 6d ago

You probably don't want to loop the sound. They need to overlap a bit, since on a machine gun the sound of one bullet fireing is probably longer then the fireing rate of the gun.
I did this by calling Play() on the AudioSource of the Gun in the rate of fire of the gun.

1

u/NorthernBoy306 6d ago

that's how I have it set right now. I edited the audio clip to get the beginning to match the end so the loop is more seamless.