# Getting channelgroup from event instance throwing error?

**URL:** <https://qa.fmod.com/t/getting-channelgroup-from-event-instance-throwing-error/15252>\
**Category:** Unity\
**Created:** [November 27, 2019, 5:29am UTC](https://qa.fmod.com/t/getting-channelgroup-from-event-instance-throwing-error/15252 "2019-11-27T05:29:19Z")\
**Posts on this page:** 3\
**Page:** 1

<div class="post-metadata">

**Author:** ![Liam8mail](https://avatars.discourse-cdn.com/v4/letter/l/e36b37/32.png) [@Liam8mail](https://qa.fmod.com/u/Liam8mail)\
**Post date:** [November 27, 2019, 5:29am UTC](https://qa.fmod.com/t/getting-channelgroup-from-event-instance-throwing-error/15252/1 "2019-11-27T05:29:19Z")

</div>

result = eventInstance.getChannelGroup(out channelGroup);  
if (result != FMOD.RESULT.OK)  
{  
Debug.Log(FMOD.Error.String(result));  
}

The specified resource is not loaded, so it can’t be unloaded.  
UnityEngine.Debug:Log(Object)

Above is the code and the error i get. The event is created and is playing back in unity. I’m not sure why I can’t return it’s channel group? any ideas?

---

<div class="post-metadata">

**Author:** ![alexzzen](https://yyz2.discourse-cdn.com/flex036/user_avatar/qa.fmod.com/alexzzen/32/6825_2.png) [@alexzzen](https://qa.fmod.com/u/alexzzen)\
**Post date:** [November 27, 2019, 10:53am UTC](https://qa.fmod.com/t/getting-channelgroup-from-event-instance-throwing-error/15252/2 "2019-11-27T10:53:07Z")

</div>

It is not possible to get the ChannelGroup until the Event Instance is successfully loaded. Try to loop until the result is FMOD.RESULT.OK. I do that in a coroutine like this:

```
 IEnumerator GetChannelGroup()
{
    if (instance.isValid())
    {
        while (instance.getChannelGroup(out channelGroup) != FMOD.RESULT.OK)
        {
            yield return new WaitForEndOfFrame();
        }

   // do stuff

    }
    else
    {
        Debug.Log("Instance not valid");
        yield return null;
    }
}
```

---

<div class="post-metadata">

**Author:** ![Liam8mail](https://avatars.discourse-cdn.com/v4/letter/l/e36b37/32.png) [@Liam8mail](https://qa.fmod.com/u/Liam8mail)\
**Post date:** [November 27, 2019, 8:25pm UTC](https://qa.fmod.com/t/getting-channelgroup-from-event-instance-throwing-error/15252/3 "2019-11-27T20:25:44Z")

</div>

Hey, I kinda thought this might be the issue! but i never tried it out for some reason. Thank you so much for your reply, extremely helpful!
