I can't get my Behavior Tree Task to read a variable from my Character

Hello. I am trying to design a behavior tree that I can use for every NPC in my game. I am trying to design a system where an Integer value on a CharacterBP will determine what branch runs down a behavior tree. Like so:

I have my integers set up in character BP for the NPC.
EDIT: I updated this- it no longer changes the AI controller. I didn’t see any reason to change it since I can use one AI controller and have all the behavior trees in one tree.

The “Selected AI” is instance editable when the character is placed in the world. It then assigns a value of 0, 1, or 2. I need my Behavior Tree to be able to read this value.

Now for some reason, it ALWAYS runs the value at 0, which means something isn’t grabbing the selected variable properly. Like so:

My blueprint task NPC variant looks like this:


What am I doing wrong?

AI_NonPlayerCharacter = AI Controller
Character Reference = NPC Blueprint
Player Reference = Player Blueprint

I’m pulling my Character and Player references from the AI controller.

  1. Is the variable between BB and BTT related?

  2. I see a variable entry in BB, but I can’t see a variable being taken from BB.
    Example:
    изображение
    изображение