Making slight changes to Prefab Variant behaviors

dangoyette

New member
I'm going to be making a new variant of one of my characters, which is very similar to the current character, with some small behavior differences. I was trying to understand whether there was an efficient way to make one behavior inherit from another, with some tweaks? For example, most of the behavior between the two characters is the same (check or visibility, does a patrol loop, etc), but the different would be that one character would use ranged attacks while the other would approach for melee.

Right now, I can make them use the same behavior, and just use a variable on each character to control whether certain conditions are evaluated, but I wasn't sure whether there was a more efficient approach?
 
One idea would be to subclass the BehaviorTreeReference task and then override GetExternalBehaviors. From here you can return a different external tree based on the prefab that is loaded.
 
Top