How to check for an value in BehaiviourTask and read it in another blueprint?

How can i set a boolean variable in a task inside behaiviour tree and then read the value from the animationblueprint?

There’s no straightforward way, and we have good reasons for it. Setting and reading values from just wherever is a recipe for spaghetti code :slight_smile:

I’d suggest storing values in the blackboard, and if you really don’t want to do that then having a dedicated variables in your character class is an acceptable solution as well (especially for prototyping purposes).

Cheers,

–mieszko

I am trying to have the AI play an attack animation when it’s entering the radius of the player character. I created a task for that and used an AI move node for it. I am trying to set a boolean value to true when the ai enters this radius. Now i am trying to get this value from the animationblueprint to play an animation when the value is set to true.

I don’t know how to do the casting because i am getting errors when to cast and compile it. Any idea how to do this?

never mind it works