# State Tree variables

**URL:** <https://forums.unrealengine.com/t/state-tree-variables/728739>\
**Category:** Programming & Scripting\
**Tags:** unreal-engine, state-machines, Blueprint, CPP, question\
**Created:** [December 15, 2022, 6:38am UTC](https://forums.unrealengine.com/t/state-tree-variables/728739 "2022-12-15T06:38:20Z")\
**Posts on this page:** 1\
**Showing post:** 6

<div class="post-metadata">

**Author:** ![Anonymous\_cd45bd7fa50f0ba0cf8a540613f93d6e](https://d3kjluh73b9h9o.cloudfront.net/original/4X/2/8/5/28502927f1d97ba1051b3b47ccfe17233bf41ef0.png) [@Anonymous\_cd45bd7fa50f0ba0cf8a540613f93d6e](https://forums.unrealengine.com/u/Anonymous_cd45bd7fa50f0ba0cf8a540613f93d6e)\
**Post date:** [August 2, 2023, 9:16pm UTC](https://forums.unrealengine.com/t/state-tree-variables/728739/6 "2023-08-02T21:16:59Z")

</div>

I am replying to this old post because it’s one of the first replies that come up in Google, and it seems nobody else has posted how to do this. I explained how to get runtime variables in state trees step by step here

> [@How to assign StateTree parameters at runtime](https://forums.unrealengine.com/t/how-to-assign-statetree-parameters-at-runtime/721953/5):
>
> As far as I know, parameters are “set once, read only” data. If you want runtime parameters, you have to Make a task, global task or evaluator where the variable will be calculated. Make your variable in this object. Make it instance editable (click on the eye), or in C++ make it VisibleAnywhere or EditAnywhere (I believe either should work) Move it to the Output category. It must be spelled correctly, it won’t work otherwise. Add the task or evaluator object to the tree. If you did everything…

The tl;dr is that if you bind to a variable you’re reading from it. In order to write to a global variable that other tasks and evaluators can read, you need to make the variable you want inside a task/evaluator and set it to the Output category. Then you will be able to change it (but only from that specific object), and other tasks will be able to read it.

---

_[View the full topic](https://forums.unrealengine.com/t/state-tree-variables/728739)._
