- Home /
Behave sub-trees
I'm using AngryAnt's Behave, and I have several sub-trees, but when I have them called I don't see the Action's handler called. I've instantiated the main tree and the sub tree, and have the main tree's Tick() method called in Update(). I don't call the sub-tree's Tick() method because that would defeat the purpose of the main tree determining whether or not to call the sub-tree.
public class NonInteractiveCharacter : MonoBehaviour { private Behave.Runtime.Tree nicSelectorTree = null; private Behave.Runtime.Tree idleTree = null;
void Awake ()
{
nicSelectorTree = BLNICLibrary.InstantiateTree(
BLNICLibrary.TreeType.NonInteractiveCharacters_NICSelector,
new NICSelectorAgent());
idleTree = BLNICLibrary.InstantiateTree(
BLNICLibrary.TreeType.NonInteractiveCharacters_Idle,
new NICIdleAgent());
}
// Update is called once per frame
void Update ()
{
nicSelectorTree.Tick();
// I shouldn't have to call idle's Tick method since it's called
// from the above selector tree
//idleTree.Tick();
}
}
Thanks in advance, Scott
I have the same problem. I can't find anywhere on his site about this issue.
Answer by ivanhoe1982 · Jan 20, 2013 at 10:45 PM
I'm not 100% sure if it is the same issue, but I experienced something similar and I believe that adding the subtree to the list of trees handled by the agent blueprint class (in library properties) fixed it. With the blueprint came virtual method calls instead of reflection I think, maybe this is the only way it works.
Your answer
Follow this Question
Related Questions
Using Behave to alert other AI 1 Answer
How do I get 'Behave' (from AngryAnt.com)to work with Unity 2.6? 4 Answers
Scaling AI for Many Actors/Agents 1 Answer
enemy stopping then repathing 0 Answers
AngryAnt Behave: Tree gets resetted 0 Answers