we have started getting errors with our FMOD Unity integration in the editor recently.
We are using Unity 5.2.4f1 and the FMOD Studio Unity Integration 1.08.04. We are not doing any specific platform build, just working for Windows on a PC.

It looks like it has something to do with the OnGUI events. The errors we get on the console are these ones:

It happens when we use a parameter on our own scripts (for example, having a [FMODUnity.EventRef] public string):

NullReferenceException: Object reference not set to an instance of an object
FMODUnity.EventRefDrawer.OnGUI (Rect position, UnityEditor.SerializedProperty property, UnityEngine.GUIContent label) (at Assets/Plugins/Editor/FMOD/EventRefDrawer.cs:53)
UnityEditor.PropertyDrawer.OnGUISafe (Rect position, UnityEditor.SerializedProperty property, UnityEngine.GUIContent label) (at C:/buildslave/unity/build/Editor/Mono/ScriptAttributeGUI/PropertyDrawer.cs:23)
UnityEditor.PropertyHandler.OnGUI (Rect position, UnityEditor.SerializedProperty property, UnityEngine.GUIContent label, Boolean includeChildren) (at C:/buildslave/unity/build/Editor/Mono/ScriptAttributeGUI/PropertyHandler.cs:134) …

Or when trying to look at an item on the Event Browser from the FMOD top menu:

NullReferenceException: Object reference not set to an instance of an object
FMODUnity.EventBrowser.PreviewEvent (Rect previewRect, FMODUnity.EditorEventRef selectedEvent) (at Assets/Plugins/Editor/FMOD/EventBrowser.cs:651)
FMODUnity.EventBrowser.OnGUI () (at Assets/Plugins/Editor/FMOD/EventBrowser.cs:473)
System.Reflection.MonoMethod.Invoke (System.Object obj, BindingFlags invokeAttr, System.Reflection.Binder binder, System.Object[] parameters, System.Globalization.CultureInfo culture) (at /Users/builduser/buildslave/mono-runtime-and-classlibs/build/mcs/class/corlib/System.Reflection/MonoMethod.cs:222)

At first we didn’t have this issues for a long time using the integration, but now the only thing that I can think of that can have some relation to when it started happening, is that we changed the Asset Serialization Mode to “Force Text”.

Could this be the reason for the error showing up now? I’ve been looking around but haven’t seen anything that solves the problem. The most similar thing that I’ve found is this issue: , but it’s been 3 years since that and, as the answer suggests, I think that problem would be solved now.

Has anybody faced a similar error or know how to solve this?
Thank you very much!

  • You must to post comments
Best Answer

Well, it seems like I have solved the issue.

I deleted every FMOD folder and file from the Unity project, then downloaded the integration and imported it again (having the Asset Serialization to Force Text from the beginning). Now it runs completely fine.

What I think it happened is that when changing the Asset Serialization mode to Force Text, something went wrong and corrupted some file maybe? Changing the mode without doing anything else didn’t solve the issue. Installing again the integration without deleting anything didn’t solve the issue neither. Deleting everything, then reimporting the integration and setting it again did solve it.

  • You must to post comments
Showing 1 result
Your Answer

Please first to submit.