# Getting a variable from an AI Controller to a Task in my behaviour tree

**URL:** <https://forums.unrealengine.com/t/getting-a-variable-from-an-ai-controller-to-a-task-in-my-behaviour-tree/2248551>\
**Category:** AI\
**Tags:** unreal-engine, Blueprint, question\
**Created:** [December 29, 2024, 9:52am UTC](https://forums.unrealengine.com/t/getting-a-variable-from-an-ai-controller-to-a-task-in-my-behaviour-tree/2248551 "2024-12-29T09:52:23Z")\
**Posts on this page:** 1\
**Page:** 1

<div class="post-metadata">

**Author:** ![Bastinator3](https://d3kjluh73b9h9o.cloudfront.net/original/4X/2/8/5/28502927f1d97ba1051b3b47ccfe17233bf41ef0.png) [@Bastinator3](https://forums.unrealengine.com/u/Bastinator3)\
**Post date:** [December 29, 2024, 9:52am UTC](https://forums.unrealengine.com/t/getting-a-variable-from-an-ai-controller-to-a-task-in-my-behaviour-tree/2248551/1 "2024-12-29T09:52:23Z")

</div>

Hello, I am currently writing an AI with reinforcement learning and am facing the following problem. A variable I am using for calculations is used in my AI Controller. The result of this calculation is needed in a task called “roamaround” in my behaviuour tree, where i need it for further calculation. So I need a way to constantly get the new result in the task of my behaviour tree. Anyone knows what to do?
