astar - SetEnable(false) on a behaviour turns off RichAI RecalulatePathsAutomatically field

bbjones

Member
I'm trying to get my version of FollowLeader working where I set up the agents in code at runtime.

It works, but when I setup each agent, I turn off their current BehaviourTree via SetEnable(false). It seems calling that method (or manually disabling off the BT component in the editor at runtime) will turn off the RichAI RecalculatePathsAutomatically field (sets it to Never).

I'm currently using this workaround to set the autopath policy in code when I init my agents:
C#:
                // we also need to turn the RichAI recalc back on, seems turning off the BT sets this field to NEVER
                AutoRepathPolicy pathPolicy = new AutoRepathPolicy();
                pathPolicy.mode = AutoRepathPolicy.Mode.EveryNSeconds;
                pathPolicy.period = 1;
                aStarAgents[i].autoRepath = pathPolicy;

I suppose my question is why does that get turned off?
 
The A* integration doesn't change that property at all so it may be something on the A* side of things.
 
Top