7. AI Controller Blueprint: Initial Blackboard Values

Choose your OS:

Now we need to set the "HomeLocation" key on the Blackboard. This is a more involved step.

Steps

  1. You need a Get Blackboard node and a Get Controlled Pawn node.

    getBBandCPnodes.png

  2. Get a Reference to Self node from the Right-click context menu and connect it to the Get Blackboard node.

    addSelf.png

  3. Drag off the Return Value of the Get Blackboard node, search for "Vector", and create a Set Value as Vector node.

    createSetKeyVectorNode.png

  4. Drag off the Return Value of the Get Controlled Pawn node and create a Get Actor Location node.

    actorLoc.png

  5. Connect the Return Value pin of the Get Actor Location node to the Vector Value pin of the Set Value as Vector node.

    connectedALtoSV.png

  6. Drag off Key Name on the Set Value as Vector node and use Promote to Variable from the context menu.

    promoteText.png

  7. The variable should be awaiting a name in the My Blueprint panel, name the variable to HomeLocation.

    • If you clicked anywhere before naming the variable, you can rename it in the My Blueprint panel using the Right-click context menu.

    hlconnected.png

  8. Compile the Blueprint.

  9. Select the HomeLocationKey variable in the My Blueprint Panel.

  10. In the Details panel, change its Default Value to the exact name of the Vector Value on the Blackboard, in this case, "HomeLocation"

    homeLocationDetails.png

  11. Connect the output execution pin of the Use Blackboard node to the input execution pin of the Set Value as Vector node.

    execution2.png

In the next step we'll continue editing this graphs and add to this graph to make the AI Controller run the desired Behavior Tree.