Reply To: [Bug] Graph OnEnable() fires on Load, causes errors

NodeCanvas Forums Support [Bug] Graph OnEnable() fires on Load, causes errors Reply To: [Bug] Graph OnEnable() fires on Load, causes errors

#15212
snugglepilot
Participant

Sure, here’s the error I’m getting:
TargetException: Non-static field requires a target

at System.Reflection.MonoField.SetValue (System.Object obj, System.Object val, System.Reflection.BindingFlags invokeAttr, System.Reflection.Binder binder, System.Globalization.CultureInfo culture) [0x00000] in <00000000000000000000000000000000>:0

at System.Reflection.FieldInfo.SetValue (System.Object obj, System.Object value) [0x00000] in <00000000000000000000000000000000>:0

at ParadoxNotion.Serialization.FullSerializer.Internal.fsReflectedConverter.TryDeserialize (ParadoxNotion.Serialization.FullSerializer.fsData data, System.Object& instance, System.Type storageType) [0x00000] in <00000000000000000000000000000000>:0

at ParadoxNotion.Serialization.FullSerializer.fsSerializer.Internal_Deserialize (ParadoxNotion.Serialization.FullSerializer.fsData data, System.Type storageType, System.Object& result, System.Type overrideConverterType) [0x00000] in <00000000000000000000000000000000>:0

at ParadoxNotion.Serialization.FullSerializer.fsSerializer.TryDeserialize (ParadoxNotion.Serialization.FullSerializer.fsData data, System.Type storageType, System.Object& result, System.Type overrideConverterType) [0x00000] in <00000000000000000000000000000000>:0

at ParadoxNotion.Serialization.FullSerializer.Internal.fsReflectedConverter.TryDeserialize (ParadoxNotion.Serialization.FullSerializer.fsData data, System.Object& instance, System.Type storageType) [0x00000] in <00000000000000000000000000000000>:0

at ParadoxNotion.Serialization.FullSerializer.fsSerializer.Internal_Deserialize (ParadoxNotion.Serialization.FullSerializer.fsData data, System.Type storageType, System.Object& result, System.Type overrideConverterType) [0x00000] in <00000000000000000000000000000000>:0

at ParadoxNotion.Serialization.FullSerializer.fsSerializer.TryDeserialize (ParadoxNotion.Serialization.FullSerializer.fsData data, System.Type storageType, System.Object& result, System.Type overrideConverterType) [0x00000] in <00000000000000000000000000000000>:0

at ParadoxNotion.Serialization.FullSerializer.Internal.fsReflectedConverter.TryDeserialize (ParadoxNotion.Serialization.FullSerializer.fsData data, System.Object& instance, System.Type storageType) [0x00000] in <00000000000000000000000000000000>:0

at ParadoxNotion.Serialization.FullSerializer.fsSerializer.Internal_Deserialize (ParadoxNotion.Serialization.FullSerializer.fsData data, System.Type storageType, System.Object& result, System.Type overrideConverterType) [0x00000] in <00000000000000000000000000000000>:0

at ParadoxNotion.Serialization.FullSerializer.fsSerializer.TryDeserialize (ParadoxNotion.Serialization.FullSerializer.fsData data, System.Type storageType, System.Object& result, System.Type overrideConverterType) [0x00000] in <00000000000000000000000000000000>:0

at ParadoxNotion.Serialization.FullSerializer.Internal.fsListConverter.TryDeserialize (ParadoxNotion.Serialization.FullSerializer.fsData data, System.Object& instance_, System.Type storageType) [0x00000] in <00000000000000000000000000000000>:0

at ParadoxNotion.Serialization.FullSerializer.fsSerializer.Internal_Deserialize (ParadoxNotion.Serialization.FullSerializer.fsData data, System.Type storageType, System.Object& result, System.Type overrideConverterType) [0x00000] in <00000000000000000000000000000000>:0

at ParadoxNotion.Serialization.FullSerializer.fsSerializer.TryDeserialize (ParadoxNotion.Serialization.FullSerializer.fsData data, System.Type storageType, System.Object& result, System.Type overrideConverterType) [0x00000] in <00000000000000000000000000000000>:0

at ParadoxNotion.Serialization.FullSerializer.Internal.fsReflectedConverter.TryDeserialize (ParadoxNotion.Serialization.FullSerializer.fsData data, System.Object& instance, System.Type storageType) [0x00000] in <00000000000000000000000000000000>:0

at ParadoxNotion.Serialization.FullSerializer.fsSerializer.Internal_Deserialize (ParadoxNotion.Serialization.FullSerializer.fsData data, System.Type storageType, System.Object& result, System.Type overrideConverterType) [0x00000] in <00000000000000000000000000000000>:0

at ParadoxNotion.Serialization.FullSerializer.fsSerializer.TryDeserialize (ParadoxNotion.Serialization.FullSerializer.fsData data, System.Type storageType, System.Object& result, System.Type overrideConverterType) [0x00000] in <00000000000000000000000000000000>:0

at ParadoxNotion.Serialization.JSONSerializer.Internal_Deserialize (System.Type type, System.String json, System.Collections.Generic.List1[T] references, System.Object instance) [0x00000] in <00000000000000000000000000000000>:0

at ParadoxNotion.Serialization.JSONSerializer.TryDeserializeOverwrite[T] (T instance, System.String json, System.Collections.Generic.List1[T] references) [0x00000] in <00000000000000000000000000000000>:0

at NodeCanvas.Framework.Graph.Deserialize (System.String serializedGraph, System.Collections.Generic.List1[T] references, System.Boolean validate) [0x00000] in <00000000000000000000000000000000>:0

at NodeCanvas.Framework.Graph.UnityEngine.ISerializationCallbackReceiver.OnAfterDeserialize () [0x00000] in <00000000000000000000000000000000>:0

UnityEngine.Logger:LogException(Exception)

ParadoxNotion.Services.Logger:ForwardToUnity(LogType, Object, String, Object)

ParadoxNotion.Services.Logger:Internal_Log(LogType, Object, String, Object)

ParadoxNotion.Services.Logger:LogException(Exception, String, Object)

NodeCanvas.Framework.Graph:Deserialize(String, List1, Boolean)

NodeCanvas.Framework.Graph:UnityEngine.ISerializationCallbackReceiver.OnAfterDeserialize()
 

This error pops up immediately upon play, basically on the first frame of the app running (before any Start() functions get called anyway).

I’m on Unity 2020.1.1f1, with the latest NodeCanvas in the PackageManager: 3.0.9

My graph is fairly simple, but it does contain some reflection references (execute function on local script) that show up as red in the behaviour tree if I don’t have the prefab selected;

I’m guessing this is what the error is in reference to.

everything works fine and is error-free once the prefab is instantiated.