Unity fmod clip breaks entire timeline at edit time

Hello!

With the latest (and perhaps earlier?) Unity-approved fmod integration, adding an fmod track & clip to a unity timeline works fine, but editing the clip at all (changing length, or switching events) causes it to spit out the following error:

[FMOD] RuntimeManager accessed outside of runtime. Do not use RuntimeManager for Editor-only functionality, create your own System objects instead.

since the error happens in CreatePlayable, the result is a null playable, rendering the entire timeline useless for in-editor previewing and editing.

The source issue seems to be the RuntimeManager.GetEventDescription(EventReference); call, which should only happen at runtime, but is used here at edit-time and runtime.

   public override Playable CreatePlayable(PlayableGraph graph, GameObject owner)
        {
#if UNITY_EDITOR
            if (!EventReference.IsNull)
#else
            if (!CachedParameters && !EventReference.IsNull)
#endif
            {
                FMOD.Studio.EventDescription eventDescription = RuntimeManager.GetEventDescription(EventReference);

                for (int i = 0; i < Parameters.Length; i++)
                {
                    FMOD.Studio.PARAMETER_DESCRIPTION parameterDescription;
                    eventDescription.getParameterDescriptionByName(Parameters[i].Name, out parameterDescription);
                    Parameters[i].ID = parameterDescription.id;
                }

                List<ParameterAutomationLink> parameterLinks = Template.ParameterLinks;

                for (int i = 0; i < parameterLinks.Count; i++)
                {
                    FMOD.Studio.PARAMETER_DESCRIPTION parameterDescription;
                    eventDescription.getParameterDescriptionByName(parameterLinks[i].Name, out parameterDescription);
                    parameterLinks[i].ID = parameterDescription.id;
                }

                CachedParameters = true;
            }

Hi,

Thank you for bringing this to our attention. I will pass this on to our development team to look into further.

A workaround is commenting out lines 125 - 129 in RuntimeManager.cs. Keep in mind this may cause unexpected behavior and restarting Unity should resolve most of them. I understand this isn’t ideal.

Thank you again.

What’s the status on this fix?

Hi,

The fix was included in the latest update 2.02.14, unfortunately, this is not a Unity-verified version. Our next release will be submitted for Unity verification.

Hope this helps!

1 Like