Can't set blackboard value

I am having trouble setting a blackboard value from the AIController. I try to set a value, then I print out the blackboard’s value. I always get the same default Vector, no matter what value I try to set.

Prints:

Note: this only happens when I connect the Behavior Tree. Without the BT, the BB sets and gets the same value.

What’s the Target Location variable’s value when you run the code? You can put a breakpoint on BP node and once it’s hit mouse-over on pins will tell you current value.

Do you get any callstack when crashing, or can post the log? The only guess I can make at this point is one of your BB functions is out of context - did you disable context sensitivity to be able to put a specific function in? If so then don’t :slight_smile: There’s a bug in Blueprint compiler that results in it not complaining if you’re using functions that silently take “self” as first parameter even if it’s of wrong class.

So the variable’s value is None (that was because I forgot to set the default value). So I went ahead and used a literal name:

This works, but once I add the Run BT node after the final print string, my editor crashes. This happens with both the Literal Name and the variable with the correct value.

Okay, I’ve made some progress. Now I think the problem is in my BT MoveTo task. The BT and editor does not crash when I use the wait task with a TargetLocation is set decorator. But it does with a MoveTo task

Okay I’ve solved it. The BaddiePatroller needed to be a Character rather than a Pawn. This was causing the MoveTo task to crash!

Thanks a lot for nailing it down! I’ll make a note of it and make sure it gets fixed (it should never crash!). Cheers!