I have a prefab that uses a scriptable object to manage sound effects, the game plays correctly on the editor and the sound effects are also played as expected, however when I build the PC player I get this warning message:
Script attached to ‘Hit’ in scene ‘’ is missing or no valid script is attached.
UnityEngine.GUIUtility:processEvent(Int32, IntPtr)
And if I go ahead and run the .exe file, I get this message on the system log:
tankG2018b (3)
UnityEngine.DebugLogHandler:Internal_Log(LogType, String, Object)
UnityEngine.DebugLogHandler:LogFormat(LogType, Object, String, Object[ ])
UnityEngine.Logger:Log(LogType, Object)
UnityEngine.Debug:Log(Object)
Casablanca.Tank:OnCollisionEnter(Collision) (at C:\usr\dev\Unity\Juegos\2018\A6\Assets\Casablanca\Scripts\Runtime\Tank.cs:165)
which is the line that makes reference to the scriptable object.
I tried to work around this problem by loading the asset at run time, but again, it works correctly on the editor but fails on the PC player. I haven’t tested other platforms however I’m not getting any warnings when I build the Android player.
I though this was an issue of 2018.1.b but I’m having exactly the same problem with 2018.2.b and 2017.4.