# Anyway to make a sound not stop mid-loop?

**URL:** <https://qa.fmod.com/t/anyway-to-make-a-sound-not-stop-mid-loop/11504>\
**Category:** Unity\
**Created:** [June 14, 2014, 12:33pm UTC](https://qa.fmod.com/t/anyway-to-make-a-sound-not-stop-mid-loop/11504 "2014-06-14T12:33:22Z")\
**Posts on this page:** 6\
**Page:** 1

<div class="post-metadata">

**Author:** ![thehoward](https://avatars.discourse-cdn.com/v4/letter/t/8baadc/32.png) [@thehoward](https://qa.fmod.com/u/thehoward)\
**Post date:** [June 14, 2014, 12:33pm UTC](https://qa.fmod.com/t/anyway-to-make-a-sound-not-stop-mid-loop/11504/1 "2014-06-14T12:33:22Z")

</div>

Hi, I’ve just started to playing around with fmod and unity. I have an event with a loop region that plays when a button is held down. Now when the button is released I call for the event instance to stop, but it sounds awkward when it stops in the middle of a loop, and I usually get an ugly click sound. Is there anyway to get it to stop only after the current loop has finished? Or is there some better way to make a constant firing sound (like a machine gun), for example playing oneshots over and over?

---

<div class="post-metadata">

**Author:** ![thehoward](https://avatars.discourse-cdn.com/v4/letter/t/8baadc/32.png) [@thehoward](https://qa.fmod.com/u/thehoward)\
**Post date:** [June 16, 2014, 1:39pm UTC](https://qa.fmod.com/t/anyway-to-make-a-sound-not-stop-mid-loop/11504/2 "2014-06-16T13:39:22Z")

</div>

Ah cheers. That did the trick.

---

<div class="post-metadata">

**Author:** ![Guest1](https://avatars.discourse-cdn.com/v4/letter/g/ecccb3/32.png) [@Guest1](https://qa.fmod.com/u/Guest1)\
**Post date:** [June 16, 2014, 6:40am UTC](https://qa.fmod.com/t/anyway-to-make-a-sound-not-stop-mid-loop/11504/3 "2014-06-16T06:40:13Z")

</div>

There are a couple of ways to achieve this, one way would be to set a parameter condition on the loop region, when the gun should stop shooting, adjust the parameter and the timeline cursor will continue to the end of the timeline.

---

<div class="post-metadata">

**Author:** ![topman20000](https://avatars.discourse-cdn.com/v4/letter/t/d26b3c/32.png) [@topman20000](https://qa.fmod.com/u/topman20000)\
**Post date:** [March 10, 2019, 5:09am UTC](https://qa.fmod.com/t/anyway-to-make-a-sound-not-stop-mid-loop/11504/4 "2019-03-10T05:09:52Z")

</div>

What type of parameter would you set with the machine gun sound? I’m setting up an event for a FPS AK rifle shot, but I can’t seem to figure it out to not only include the loop of the track, but also include a loop of a falling shell casing

---

<div class="post-metadata">

**Author:** ![joseph](https://yyz2.discourse-cdn.com/flex036/user_avatar/qa.fmod.com/joseph/32/264_2.png) [@joseph](https://qa.fmod.com/u/joseph)\
**Post date:** [March 11, 2019, 11:57pm UTC](https://qa.fmod.com/t/anyway-to-make-a-sound-not-stop-mid-loop/11504/5 "2019-03-11T23:57:00Z")

</div>

> I’m setting up an event for a FPS AK rifle shot, but I can’t seem to figure it out to not only include the loop of the track, but also include a loop of a falling shell casing.

Have you looked at the Machine Gun event in examples.fspro? While it lacks the triggering parameter mentioned earlier in this question, it’s a good example of a shell casting and gunshot sound in the same loop.

---

<div class="post-metadata">

**Author:** ![topman20000](https://avatars.discourse-cdn.com/v4/letter/t/d26b3c/32.png) [@topman20000](https://qa.fmod.com/u/topman20000)\
**Post date:** [March 15, 2019, 7:13pm UTC](https://qa.fmod.com/t/anyway-to-make-a-sound-not-stop-mid-loop/11504/6 "2019-03-15T19:13:09Z")

</div>

Thanks! I found the example
