The targets array should not be used inside OnSceneGUI or OnPreviewGUI. Use the single target property instead

Hi there,

I’m trying to put reverb zone snapshots into Unity’s “3D Gamekit” but it is not working. The player should be able to Trigger Enter and Trigger Exit the reverb zones using an FMOD Studio Event Emitter and a Box Collider but it does not work at all.

Whenever I try press ‘play’ in Unity, the game immediately pauses and this error appears in the console:

The targets array should not be used inside OnSceneGUI or OnPreviewGUI. Use the single target property instead.
UnityEditor.GameObjectInspector:OnForceReloadInspector ()
FMODUnity.EventManager:UpdateCache () (at Assets/Plugins/FMOD/src/Editor/EventManager.cs:315)
FMODUnity.EventManager:AffirmEventCache () (at Assets/Plugins/FMOD/src/Editor/EventManager.cs:57)
FMODUnity.EventManager:EventFromString (string) (at Assets/Plugins/FMOD/src/Editor/EventManager.cs:840)
FMODUnity.EventManager:EventFromPath (string) (at Assets/Plugins/FMOD/src/Editor/EventManager.cs:833)
FMODUnity.StudioEventEmitterEditor:OnSceneGUI () (at Assets/Plugins/FMOD/src/Editor/StudioEventEmitterEditor.cs:24)
UnityEngine.GUIUtility:ProcessEvent (int,intptr)

Any help appreciated x

What version of FMOD are you using? I suspect this is part of a bug we recently adressed that occured when hitting play while an object containing an FMOD Component was selected and displayed in the inspector. Can you please verify whether the error still occurs when a different object is selected?
If so you can try updating to one of the latest releases (2.00.19, 2.01.11 or 2.02.02), otherwise if you could give me your Unity and FMOD versions I will investigate further.

My FMOD version is 2.01.07 and my Unity version is 2019.4.26f1.

Edit: I just updated FMOD to 2.01.11 and the error is not coming up any more, but the reverb zone triggers are still not working.

Good to hear that resolved the errors- as for the trigger issue, one thing to check is that “Is Trigger” is ticked on the Box Collider and that your player has a rigid body attached. Let me know if it’s already setup like that or if it’s still not working and I’ll investigate further!