Behavior Editor crash on Owner.DisableBehavior()

abc123

Member
I'm having a quite annoying issue with behavior editor. Unfortunately, I can't provide a scene, but may be it's a known issue. So my AI has an external behavior, which pauses/resumes itself when state of the character changes (dead/alive). This is done in a root task, which is subscribed to mentioned event.

111.PNG222.PNG

Everything works fine, tested on multiple characters dying and respawning in battles.

But, if when character dies, his behavior is open in Behavior Editor, its a 100% crash at line 78:

333.PNG

Task no longer has an Owner? Let me emphasize - it happens only if Behavior Editor is open and character's behavior selected.

Any suggestions on what might be causing this? Currently I have to close/reopen Behavior Editor each time focused AI dies..
 
Last edited:
Hmm, this one is tough to say. Does the error only occur when the editor is attached? If you do a null check do things still work properly?
 
Hmm, this one is tough to say. Does the error only occur when the editor is attached? If you do a null check do things still work properly?
I'm not sure about the first question. I thought the editor is always attached when opened, I don't know how to detach it.

With a null check there are no errors, but also there is no stopping/resuming behavior, because it considers Owner a null.
 
Ok, Justin, I invested some time to reproduce this in a blank project. You can find the scene in attachment. Really hoping for a fix or workaround, because this issue costs a lot of nerves.

This simple scene reflects how it works in my main project. So we have an object (sphere) with a SphereController component. On Awake it instantiates external behavior, deserializes it, adds BehaviorTree component and links them together. All the behavior does is drags the sphere up. SphereController checks its position on Update, and at some height starts to drag the sphere down until it hits the floor. At the same time it fires an event with a bool parameter. The root task CustomRepeater is subscribed to this event, so it toggles behavior on/off via Owner.

As you can see on a video demonstration, everything is fine until I have the behavior selected in editor.

 

Attachments

  • SampleScene.zip
    6.9 KB · Views: 1
Last edited:
Thanks for the sample scene. Can you send me a PM with your unity version and I'll send you a fixed Behavior Designer version?
 
Top