Behavior Editor Freeze Error - Stack Overflow error message

Solos Interactive 1 month ago in Behavior updated by Marti (Lead Developer) 2 weeks ago 22 3 duplicates

Hi there. There seems to be an issue with the behaviour editor - whenever I attempt to "create", either a task, decorator or anything else, the entire editor window freezes.

This is the first time I've tried working on Behavior, up to now I've focused on the Stats, General and Melee modules. It could be due to the Unity version, however you would have to advise on this.


Unity version:
Game Creator version:

Duplicates 3

Under review

Freeze you mean for some milliseconds? A small freeze is normal since it has to initialize multiple systems when creating a task. However, a stack overflow error shouldn't be happening. Can you post this error so we can take a look?

Sure, the error message is below. It actually freezes the entire Editor, so much so that I have to close the project down and reopen it. Here's the stack overflow error:

StackOverflowException: The requested operation caused a stack overflow.
at (wrapper managed-to-native) UnityEditor.AssetDatabase.SaveAssets()
at GameCreator.Behavior.BehaviorGraphEditor.CreateNode[T] (GameCreator.Behavior.Node parent) [0x00085] in D:\HEROES 2020\heroes\HEROES\Assets\Plugins\GameCreator\Behavior\Editor\BehaviorTree\BehaviorGraphEditor.cs:233
at GameCreator.Behavior.BehaviorGraphEditor.CreateComposite (System.Object parent) [0x00001] in D:\HEROES 2020\heroes\HEROES\Assets\Plugins\GameCreator\Behavior\Editor\BehaviorTree\BehaviorGraphEditor.cs:166
at UnityEditor.GenericMenu.CatchMenu (System.Object userData, System.String[] options, System.Int32 selected) [0x00020] in :0

This is quite strange. What's causing this error is when saving the Behavior node. A stack overflow would only make sense if the graph is trying to save onto itself, but I've gone through the code and I haven't seen this, nor been able to reproduce this problem.

Have you tried closing and opening Unity? Also, can you consistently reproduce this? Does it always happen when creating a new Behavior Graph?

Hi. I have the same issue. Once I try to add a component, the entire editor freezes and throws a similar error.

For me, I got that error once. Most of the time, the behavior module crashes the Unity project. I can't keep it open. 

When I removed the module (had to do so manually through file-system) it worked fine again.

Hi, yes I can reproduce it every time I try to add anything in the Behavior editor. And I tried again with a new Behavior graph, in a new project, and same thing occurred. It's bizarre

After updating to Unity 2019.4.0 I no longer freeze. But still experience crashing.


Hi guys! 
I am also getting the same Problem! 
Toolbars and work fine but all assets and any functions are frozen, 

Hi, I do have the same issue, each time that I try to add anything other than a root unity will, crash or be unusable.

I even tried with a brand new project.

Hi, yes after an update to 2019.4 it freezes LESS (still freezes though), but now it has started to crash Unity all together at times. Any update on whether you are able to reproduce this bug on your side?

Freezes here as well, 2019.4, getting this error:


I've been fighting this issue to no avail. Looks it's a problem from Unity and I'm struggling to find a work around. In particular the issue comes from the new Asset Pipeline v2, which is supposed to be better and more stable.

You can change to the Asset Pipeline v1 by going to Edit -> Project Settings -> Editor, and look for the field called Asset Pipeline. Change it to "Version 1 (deprecated)" and restart Unity.

This should solve the problem. Meanwhile, I'm preparing a bug report to be sent to Unity and crossing fingers they fix this.

For those wanting to know the problem, it comes from the method AssetDatabase.SaveAssets(). When used from an Editor Window it enters an infinite loop when saving, causing the Stack Overflow. This also happens when deleting some assets (like a Behavior Graph).

Hi Marti,

Thanks for getting back to us, good idea with switching the asset pipeline as a temp fix - that did the trick. Makes sense that it's a Unity error, having a couple of other niggles with some of our custom editor windows too.


I have the same issue with unity 2019.4.0f1.  Behavior version 1,0.1.   Here is the screen shot if it helps. 

Look forward to a resolution.

Thanks Marti.    Some days you get the bear and some days the bear gets you - hang in there.  

Thanks :-) I'm keeping track of a ticket open on Unity which should resolve this issue. Looks the problem is with the Asset Pipeline. Meanwhile, try using the aforementioned workaround:

You can change to the Asset Pipeline v1 by going to Edit -> Project Settings -> Editor, and look for the field called Asset Pipeline. Change it to "Version 1 (deprecated)" and restart Unity.

Luckily this has no negative implications, apart from some bigger loading times when switching between platforms.

I have converted my project to 2019.3.14 and in quick testing it is working better.

I am only at the very early stages of this new project and would prefer to stick to LTS if i can.

Any information would still be greatly appreciated.


Unfortunately as you can imagine this broke a whole bunch of other stuff. But bright side Behavior worked.

So this is as far as i get.

Tried 2019.4.1. tried using version 1.1.8. Won't work with 2019.4.



There is a know issue with the behaviour module and 2019.4. I think this is the workaround.....

this is a known issue. I spent most of the weekend looking for a solution, but the problem is a bug in Unity's asset pipeline. Not to worry though, there's a work around. Go to Edit -> Project Settings -> Editor -> Asset Pipeline and change the version 2 to Version 1

Worked like a charm!