# loopEvent?

**URL:** <https://qa.fmod.com/t/loopevent/11328>\
**Category:** Unity\
**Created:** [March 12, 2014, 10:01pm UTC](https://qa.fmod.com/t/loopevent/11328 "2014-03-12T22:01:47Z")\
**Posts on this page:** 7\
**Page:** 1

<div class="post-metadata">

**Author:** ![AmC](https://avatars.discourse-cdn.com/v4/letter/a/f6c823/32.png) [@AmC](https://qa.fmod.com/u/AmC)\
**Post date:** [March 12, 2014, 10:01pm UTC](https://qa.fmod.com/t/loopevent/11328/1 "2014-03-12T22:01:47Z")

</div>

Hi

the integration is working great, this really is fantastic, thanks.

on the FMOD\_StudioEventEmitter there are some public variables, one them being startEventOnAwake = true;

great option which is similar to the Play On Awake within Unity.

Is is possible to add a Loop option.

i tried adding public bool loopEvent = true; and I’ve had no luck in creating the variable… I’m not a C# scripter so am only hacking away here. …

can anyone help? I want to get the Event to Loop.

Thanks in advance

---

<div class="post-metadata">

**Author:** ![ronin](https://avatars.discourse-cdn.com/v4/letter/r/ad7895/32.png) [@ronin](https://qa.fmod.com/u/ronin)\
**Post date:** [April 7, 2014, 4:31pm UTC](https://qa.fmod.com/t/loopevent/11328/2 "2014-04-07T16:31:30Z")

</div>

Thank you so much for your reply. My issue has been resolved yesterday as I’ve upgraded Unity from to 4.3.3 to 4.3.4.  
But indeed, I was confused at some point because of this button and that did not help.  
Thanks again 😉

---

<div class="post-metadata">

**Author:** ![ronin](https://avatars.discourse-cdn.com/v4/letter/r/ad7895/32.png) [@ronin](https://qa.fmod.com/u/ronin)\
**Post date:** [April 1, 2014, 6:52pm UTC](https://qa.fmod.com/t/loopevent/11328/3 "2014-04-01T18:52:59Z")

</div>

Hi,  
Unfortunately, I cannot loop my sounds either in Unity. It used to work fine though and my sounds loop in FMOD studio. I’m using FMOD studio 1.3.1 and Unity pro 4.3.3  
Any hints?

---

<div class="post-metadata">

**Author:** ![ronin](https://avatars.discourse-cdn.com/v4/letter/r/ad7895/32.png) [@ronin](https://qa.fmod.com/u/ronin)\
**Post date:** [April 3, 2014, 4:52pm UTC](https://qa.fmod.com/t/loopevent/11328/4 "2014-04-03T16:52:57Z")

</div>

AmC have you got any luck so far?  
I don’t understand what is going on. I work with perforce and just redownloaded the whole project but I keep having the same issue, my loops work fine in Fmod studio but not in Unity.

---

<div class="post-metadata">

**Author:** ![ronin](https://avatars.discourse-cdn.com/v4/letter/r/ad7895/32.png) [@ronin](https://qa.fmod.com/u/ronin)\
**Post date:** [April 3, 2014, 6:41pm UTC](https://qa.fmod.com/t/loopevent/11328/5 "2014-04-03T18:41:32Z")

</div>

After some tests it seems like the issue comes from the banks exported from Fmod Studio.  
Everything works fine in Fmod Studio.  
In Unity, if I use the regular audio listener and audio source in Unity, I can make my sounds loop but as soon as I try to use the scripts from the UnityFmodIntegration package, the sounds won’t loop.  
I tried on a new project in Unity too and the issue is the same.  
I made sure the integration package as well as fmod studio are the last as of today Fmod 1.03.03 and Unity integration package 1.03.01.  
Is it a bug?

---

<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:** [April 7, 2014, 3:01am UTC](https://qa.fmod.com/t/loopevent/11328/6 "2014-04-07T03:01:22Z")

</div>

Hi Guys,

Sorry for the delay in replying. The recommended method for making looping events is to add a loop region in FMOD Studio.

FMOD Studio has the looping audition mode which may be the cause of the confusion here, this button will repeat the the event in the tool:  
 ![](http://www.fmod.org/files/loop_audition_button.png)

If you want to make a one shot event and loop it in Unity you can just query getPlaybackState from update and wait for it to return FMOD\_STUDIO\_PLAYBACK\_IDLE or FMOD\_STUDIO\_PLAYBACK\_STOPPED, and then call start() again.

---

<div class="post-metadata">

**Author:** ![AmC](https://avatars.discourse-cdn.com/v4/letter/a/f6c823/32.png) [@AmC](https://qa.fmod.com/u/AmC)\
**Post date:** [March 14, 2014, 4:28pm UTC](https://qa.fmod.com/t/loopevent/11328/7 "2014-03-14T16:28:34Z")

</div>

Maybe I wasn’t being clear enough … so I used andreas’s code from a recent post as an example.

When I export an Event from FMOD studio … it is looping fine in Studio, but not in Unity …

so I need help on this please …

if I use this code to call the event it plays it through once and then stops.

any suggestions

```auto
using UnityEngine;
using System.Collections;
using FMOD.Studio;

public class EventEmitter : MonoBehaviour {

	FMOD.Studio.EventInstance footsteps;

	// Use this for initialization
	void Start () {

		footsteps = FMOD_StudioSystem.instance.getEvent("event:/Footsteps");
		footsteps.start();
	
	}
	
	// Update is called once per frame
	void Update () {
	
	}
}
```
