Check if player value is True on AI

Hello All!

I am having a little issue but I want to keep it as simple as possible. I want to check if a player bool is set on the AI to tell the AI to move. I haven’t really played with AI so sorry if I have no idea what I am talking about.
Currently the AI does not move at all. I am pretty sure I have gone wrong somewhere.

Thanks for any help! I appreciate it.

Tasks are basically things that the AI does, you shouldn’t use them to observe game events. For that you should use services.
To check if something is true, or validate that a task needs to happen use decorators.

Tasks happen in order from left to right. If the left one fails it jumps to the next one, based on if its a selector or a sequence.

You should create a service that watches if the player is “blinking”. And write the result into a boolean blackboard key.
With a decorator check if the boolean is true. Then execute the behavior.

So to simplify:

  • Task - Things that the ai does (movement, jump, fire a gun etc…)
  • Services - Check for whatever happens in the game. (Player died,
    somebody was blinking, how far the
    player is from the AI, run
    environment queries here etc…) and write the result to the blackboard.
  • Decorators - Check stuff about the blackboard.

Here you can read more about behaviour trees:

Note that some stuff is not implemented in ue4 or is implemented completely differently. (Like parallel and other things are no running really parallel, but that shouldn’t affect the behavour of the system.)
I hope my answer helps to summarize the behavior trees :slight_smile: