I'm getting relatively large GC allocs at runtime, looks like it's something in Behavior Designer. The other 2 GC spikes are the same thing, a list.Add() call coming from BehaviorManager
I'm on 1.7.7p1
Ah I forgot to add that the tree is set to 'Restart when complete' and does not reset values on restart, but just to check I used this tree and observed the same behavior:
My point was that, shouldn't the initialization of the tree happen in Awake(), not Start(), because then race conditions...
Here's a test case which doesn't work for me, is there something I'm missing then?
Set up a tree watching an event called "Testing"
With a script:
using BehaviorDesigner.Runtime;
using UnityEngine;
public class test : MonoBehaviour
{
// Start is called before the first frame update...
What happens is a prefab containing a Behavior Tree component is instantiated, and that prefabs Start() method sends an event to the Behavior Tree. Do nodes on the tree all get initialized (including event registering) in Awake() ? I'm not sure how else the tree wouldn't be ready to recieve...
This is a bug no? The common behavior in the unity framework expects components to be ready to go at Start, initialization should be completed by the end of Awake.
I have an event which I want to send to the tree on start:
private void Start()
{
if (InitialDestination.HasValue)
{
Debug.Log($"sending destination {InitialDestination.Value}");
_behaviorTree.SendEvent<object>("RecievedDestination"...
I have an Enum:
[Flags]
public enum NavMeshAreas
{
None = 0,
Walkable = 1, NotWalkable = 2, Jump = 4,
All = ~0,
}
Behavior designer does not allow multi-selecting, only toggling. Is there a workaround for this?
After I re-enabled the branches on the tree, it started working without any other changes. Is there some funniness going on with editing the tree within a prefab and clicking play before exiting? I notice sporadic issues sometimes and I'm not sure what the cause is.
I get similar behavior Pausing and unpausing the script through code:
If I pause the behavior inside the event, then resume it later once the animation finishes (with the same animation event), the tree resumes inside the Send Event, where it calls the Update function a second time, and it...
This is the part where it gets stuck, I added a log to the SetTrigger task which you can see. When the animation ends it fires an animation event which is recieved by a script, which enables the tree again.
// triggered by keypoint in attack animation
private void SkillFinished()
{...
I'm getting errors trying to store the result of a FindObjectWithTag into a dynamic variable.
The error is:
NullReferenceException: Object reference not set to an instance of an object BehaviorDesigner.Runtime.Tasks.Unity.UnityGameObject.FindGameObjectsWithTag.OnUpdate () (at Assets/Behavior...
As per the title, when resuming the tree it re-runs the StopBehaviorTree task, so your tree gets stuck in a state of constantly paused. I would have expected the node completes and THEN the pause starts, so it resumes at the next node on the tree.