0

I am trying to keep a Behavior Tree Component within a Prefab

Jon Baxter 3 weeks ago in Behavior updated 3 weeks ago 3

I have an NPC Prefab that I would like to have ready to grab and place in my scene, so I can quickly add it into the game multiple times. This prefab has a healing function I created with a Behavior Tree. However, when I put the Behavior Tree into my prefab, the Behavior Tree disappears next time I open it, even if I drag the prefab into my scene and look for it there. I would rather not have to add the Behavior Tree to every NPC prefab I put into the game, because this will slow me down. 

-About the healing function I made: I will add a screenshot. I tried to make it within the prefab's game object, but cannot figure out another way to have the action to repeat. I want all NPCs/Monsters in my game to have this healing function, so I'm working on a way to not have it be so encumbering. The only way I could get this to work was to use the Behavior Component's "On Complete- Repeat Forever" function. It works good this way, but will be bothersome to add to every NPC in the scene.

Unity version:
2019.4.4f1 Personal
Game Creator version:
1.1.9

Also, for fun, I made a Merchant Prefab, and this problem does not happen with the Merchant. The Open Merchant UI action follows through when dragging my prefab into the scene.

This first picture is while editing the Prefab file, with the Behavior Graph there.

The second picture is dragging the Prefab into scene.

The third picture is showing the Behavior Graph disappearing.