[Resolved] Behavior Designer doesn't work with Unity 2021.2 (Beta)

Dorcan

New member
Hello !

For our project we need some features that are coming in Unity 2021.2. Everything works when upgrading to the latest beta, except Behavior Designer.

Basically we get this error at runtime and when opening any external behavior :
MissingMethodException: Method 'Cannot create an abstract class '{0}'..BehaviorDesigner.Runtime.SharedVariable' not found.
(I found a kind of similar issue in the forums but it wasn't the same problem origin)

I understand it's a beta version of Unity and not a top priority to fix before the stable version release, but maybe there is a simple workaround that exists ? ?

Thanks,
Daniel

P.S: Here's the complete error log:
MissingMethodException: Method 'Cannot create an abstract class '{0}'..BehaviorDesigner.Runtime.SharedVariable' not found.
System.RuntimeType.CreateInstanceMono (System.Boolean nonPublic, System.Boolean wrapExceptions) (at <3dd53bbd0ae9463fb53361469bbd0679>:0)
System.RuntimeType.CreateInstanceSlow (System.Boolean publicOnly, System.Boolean wrapExceptions, System.Boolean skipCheckThis, System.Boolean fillCache) (at <3dd53bbd0ae9463fb53361469bbd0679>:0)
System.RuntimeType.CreateInstanceDefaultCtor (System.Boolean publicOnly, System.Boolean skipCheckThis, System.Boolean fillCache, System.Boolean wrapExceptions, System.Threading.StackCrawlMark& stackMark) (at <3dd53bbd0ae9463fb53361469bbd0679>:0)
System.Activator.CreateInstance (System.Type type, System.Boolean nonPublic, System.Boolean wrapExceptions) (at <3dd53bbd0ae9463fb53361469bbd0679>:0)
System.Activator.CreateInstance (System.Type type, System.Boolean nonPublic) (at <3dd53bbd0ae9463fb53361469bbd0679>:0)
BehaviorDesigner.Runtime.TaskUtility.CreateInstance (System.Type t) (at <58623c9461324266a5b7839460bb9d26>:0)
BehaviorDesigner.Runtime.JSONDeserialization.ValueToObject (BehaviorDesigner.Runtime.Tasks.Task task, System.Type type, System.Object obj, BehaviorDesigner.Runtime.IVariableSource variableSource, System.Collections.Generic.List`1[T] unityObjects) (at <58623c9461324266a5b7839460bb9d26>:0)
BehaviorDesigner.Runtime.JSONDeserialization.DeserializeObject (BehaviorDesigner.Runtime.Tasks.Task task, System.Object obj, System.Collections.Generic.Dictionary`2[TKey,TValue] dict, BehaviorDesigner.Runtime.IVariableSource variableSource, System.Collections.Generic.List`1[T] unityObjects) (at <58623c9461324266a5b7839460bb9d26>:0)
BehaviorDesigner.Runtime.JSONDeserialization.ValueToObject (BehaviorDesigner.Runtime.Tasks.Task task, System.Type type, System.Object obj, BehaviorDesigner.Runtime.IVariableSource variableSource, System.Collections.Generic.List`1[T] unityObjects) (at <58623c9461324266a5b7839460bb9d26>:0)
BehaviorDesigner.Runtime.JSONDeserialization.DeserializeObject (BehaviorDesigner.Runtime.Tasks.Task task, System.Object obj, System.Collections.Generic.Dictionary`2[TKey,TValue] dict, BehaviorDesigner.Runtime.IVariableSource variableSource, System.Collections.Generic.List`1[T] unityObjects) (at <58623c9461324266a5b7839460bb9d26>:0)
BehaviorDesigner.Runtime.JSONDeserialization.DeserializeSharedVariable (System.Collections.Generic.Dictionary`2[TKey,TValue] dict, BehaviorDesigner.Runtime.IVariableSource variableSource, System.Boolean fromSource, System.Collections.Generic.List`1[T] unityObjects) (at <58623c9461324266a5b7839460bb9d26>:0)
BehaviorDesigner.Runtime.JSONDeserialization.ValueToObject (BehaviorDesigner.Runtime.Tasks.Task task, System.Type type, System.Object obj, BehaviorDesigner.Runtime.IVariableSource variableSource, System.Collections.Generic.List`1[T] unityObjects) (at <58623c9461324266a5b7839460bb9d26>:0)
BehaviorDesigner.Runtime.JSONDeserialization.DeserializeObject (BehaviorDesigner.Runtime.Tasks.Task task, System.Object obj, System.Collections.Generic.Dictionary`2[TKey,TValue] dict, BehaviorDesigner.Runtime.IVariableSource variableSource, System.Collections.Generic.List`1[T] unityObjects) (at <58623c9461324266a5b7839460bb9d26>:0)
BehaviorDesigner.Runtime.JSONDeserialization.DeserializeTask (BehaviorDesigner.Runtime.BehaviorSource behaviorSource, System.Collections.Generic.Dictionary`2[TKey,TValue] dict, System.Collections.Generic.Dictionary`2[System.Int32,BehaviorDesigner.Runtime.Tasks.Task]& IDtoTask, System.Collections.Generic.List`1[T] unityObjects) (at <58623c9461324266a5b7839460bb9d26>:0)
BehaviorDesigner.Runtime.JSONDeserialization.DeserializeTask (BehaviorDesigner.Runtime.BehaviorSource behaviorSource, System.Collections.Generic.Dictionary`2[TKey,TValue] dict, System.Collections.Generic.Dictionary`2[System.Int32,BehaviorDesigner.Runtime.Tasks.Task]& IDtoTask, System.Collections.Generic.List`1[T] unityObjects) (at <58623c9461324266a5b7839460bb9d26>:0)
BehaviorDesigner.Runtime.JSONDeserialization.Load (BehaviorDesigner.Runtime.TaskSerializationData taskData, BehaviorDesigner.Runtime.BehaviorSource behaviorSource) (at <58623c9461324266a5b7839460bb9d26>:0)
BehaviorDesigner.Runtime.BehaviorSource.CheckForSerialization (System.Boolean force, BehaviorDesigner.Runtime.BehaviorSource behaviorSource) (at <58623c9461324266a5b7839460bb9d26>:0)
BehaviorDesigner.Runtime.Behavior.CheckForSerialization (System.Boolean forceSerialization) (at <58623c9461324266a5b7839460bb9d26>:0)
BehaviorDesigner.Runtime.Behavior.CheckForSerialization () (at <58623c9461324266a5b7839460bb9d26>:0)
BehaviorDesigner.Runtime.BehaviorManager.LoadBehavior (BehaviorDesigner.Runtime.Behavior behavior, UnityEngine.GameObject behaviorGameObject, System.String gameObjectName, UnityEngine.Transform behaviorTransform) (at <58623c9461324266a5b7839460bb9d26>:0)
BehaviorDesigner.Runtime.BehaviorManager.EnableBehavior (BehaviorDesigner.Runtime.Behavior behavior) (at <58623c9461324266a5b7839460bb9d26>:0)
BehaviorDesigner.Runtime.Behavior.EnableBehavior () (at <58623c9461324266a5b7839460bb9d26>:0)
BehaviorDesigner.Runtime.Behavior.set_ExternalBehavior (BehaviorDesigner.Runtime.ExternalBehavior value) (at <58623c9461324266a5b7839460bb9d26>:0)
 
Ok so I finally found out what was the problem.

I thought it had something to do with upgrading to 2021.2, but as it was still possible to create new external behaviors and add tasks, it was clear it was because of something we did.

Actually it was a refactoring of a namespace after the upgrade which created the issue, and it concerned quite a few behavior tasks we made. I assumed at first it had something to do with the upgrade because the behavior designer window would stay empty when trying to open any previously made external behaviors.

So to fix the problem I launched with VS a text replacement to fix any wrong namespace reference in .asset files. And it worked.

All good, you can close this thread.
Thanks. ?
 
Last edited:
Top