[SOLVED] How to pass settings to BehaviorTree Blackboard at start?

I’m trying to pass some initial values to the blackboard before starting logic but it seems it doesn’t work unless I keep ‘Auto Start’ on. What I’ve tried is this, but the blackboard never updates.

            var behave = Actor.GetScript<Behavior>();
            blackboard.MoveSpeed = settings.DefaultSpeed;
            behave.Knowledge.Blackboard = blackboard;
            behave.StartLogic(); //Values are still default

I’ve tried moving this code to different events as well as waiting several frames before running it but to no avail.

EDIT: Solved - you must StartLogic() before passing any parameters:

    behave.StartLogic();
    blackboard.MoveSpeed = settings.DefaultSpeed;
    behave.Knowledge.Blackboard = blackboard;
1 Like