# Event State Problem

**URL:** <https://qa.fmod.com/t/event-state-problem/20853>\
**Category:** Unity\
**Created:** [November 8, 2023, 12:52pm UTC](https://qa.fmod.com/t/event-state-problem/20853 "2023-11-08T12:52:09Z")\
**Posts on this page:** 3\
**Page:** 1

<div class="post-metadata">

**Author:** ![Kenken0615](https://avatars.discourse-cdn.com/v4/letter/k/e36b37/32.png) [@Kenken0615](https://qa.fmod.com/u/Kenken0615)\
**Post date:** [November 8, 2023, 12:52pm UTC](https://qa.fmod.com/t/event-state-problem/20853/1 "2023-11-08T12:52:09Z")

</div>

Hello, i make an event which contains loop reigon like this:

 ![image](https://canada1.discourse-cdn.com/flex036/uploads/fmod/original/2X/5/50cbf31f082bd140f3d754de1048ef32da88654c.png)  
And this is callback set to event:  
 ![image](https://canada1.discourse-cdn.com/flex036/uploads/fmod/original/2X/6/65f241168218de7256efdde8a60ecb6682a6c6bc.png)

And here is how i post the event:

```auto
public static int PostEvent(
        string eventName, Transform tr = null,
        int delayPost = 0, int duration = 0, Action callBack = null, float volume = 1)
    {
        LoadBank(data.BankName);

        EventInstance instance;
        instance = RuntimeManager.CreateInstance(data.EventID);
        instance.setVolume(volume);
        instance.setCallback(EventCallBack);
        return instance.GetHashCode();
    }

```

The problem is that, when i call this event, the event will be in stopped state when the first loop reaches end but the event is still looping…  
Any reason? Thank you very much!!!

---

<div class="post-metadata">

**Author:** ![Leah\_FMOD](https://yyz2.discourse-cdn.com/flex036/user_avatar/qa.fmod.com/leah_fmod/32/3685_2.png) [@Leah\_FMOD](https://qa.fmod.com/u/Leah_FMOD)\
**Post date:** [November 14, 2023, 1:07am UTC](https://qa.fmod.com/t/event-state-problem/20853/2 "2023-11-14T01:07:16Z")

</div>

The issue appears to be that the callback being checked for is [`EVENT_CALLBACK_TYPE.SOUND_STOPPED`](https://www.fmod.com/docs/2.02/api/studio-api-eventinstance.html#fmod_studio_event_callback_sound_stopped) instead of [`EVENT_CALLBACK_TYPE.STOPPED`](https://www.fmod.com/docs/2.02/api/studio-api-eventinstance.html#fmod_studio_event_callback_stopped). `SOUND_STOPPED` will fire every loop because the instrument stops at the end of the loop and is triggered again when the loop restarts. `STOPPED`, on the other hand, will only fire when the entire event has stopped.

---

<div class="post-metadata">

**Author:** ![Kenken0615](https://avatars.discourse-cdn.com/v4/letter/k/e36b37/32.png) [@Kenken0615](https://qa.fmod.com/u/Kenken0615)\
**Post date:** [November 14, 2023, 3:51am UTC](https://qa.fmod.com/t/event-state-problem/20853/3 "2023-11-14T03:51:23Z")

</div>

Thank you so much!
