'EventInstance::set3DAttributes <...> returned ERR_INVALID_HANDLE for STUDIO EVENTINSTANCE' when calling RuntimeManager.PlayOneShotAttached

Hello!

I sometimes get this error when calling RuntimeManager.PlayOneShotAttached(GUID guid, GameObject gameObject):

Error: [FMOD] EventInstance::set3DAttributes(2123264, {{-8.381,9.134,28.811},{0,0,0},{-0.00587976,-0.999773,0.0204928},{0.961222,-3.27826e-07,0.275775}}) returned ERR_INVALID_HANDLE for STUDIO_EVENTINSTANCE (0x206600).

It seems completely random - sometimes the error gets thrown, sometimes it doesn’t.

Also I personally can’t hear anything wrong when it happens - the sound seems to get played as usual.

I’ve seen a couple of similar topics here (where the error happens when doing ‘getParameterByName’ or ‘getPlayBackState’), but I don’t interact with the sound event instance in any way. Since it’s a ‘one-shot’-method, I just trigger the sound and forget about it. I don’t call ‘set3DAttributes’ anywhere.

In ‘FMODStudioSettings’ my error logging mode is set to ‘Error’, and ‘Enable API Error Logging’ is ticked.

What is this error, why does it happen and how bad is it? Do I need to do anything about it, or just set the error logging to a lower setting?

Hi,

There is a complete list of all FMOD Errors which can be found under Core API | Common, which can be really useful for debugging FMOD Functions.

I have reproduced this issue by calling PlayOneShotAttached very frequently. Are you playing a high number of sounds this way? If so, it might be worth limiting how many times this Call is made and how frequently. If it’s only being called infrequently, let me know and I’ll investigate further.

Hope this helps!

Thanks for the answer. I actually do have cases where several sounds get triggered with PlayOneShotAttached at the same game object within a single frame.

How many is too many? :slight_smile: What’s the approximate threshold for the bug to get thrown?

And how bad is it? Do I have to avoid the bug somehow (make some sounds play unattached, introduce a limit of attached one-shot sounds which can be played within a given time period), or is it not critical and I can ignore it?

Hi,

After further investigation, I was not able to replicate the issue in our API, so it seems something is happening in the Unity Integration. I have passed it on to our dev team to look into further and hopefully find a solution. In the meantime, could you explain how you are using the PlayOneShotAttached? If it is not notably affecting the sound in your project it should be ok to ignore it till we find a solution. On the other hand, we could work together to find a way to avoid the issue.

Thanks!