# Variables in Behaviour Tree task

**URL:** <https://forums.unrealengine.com/t/variables-in-behaviour-tree-task/387996>\
**Category:** AI\
**Tags:** Behavior-Tree, unreal-engine, UE4, Blueprint, question\
**Created:** [March 15, 2017, 1:59pm UTC](https://forums.unrealengine.com/t/variables-in-behaviour-tree-task/387996 "2017-03-15T13:59:52Z")\
**Posts on this page:** 3\
**Page:** 1

<div class="post-metadata">

**Author:** ![AiVeR](https://d3kjluh73b9h9o.cloudfront.net/original/4X/2/8/5/28502927f1d97ba1051b3b47ccfe17233bf41ef0.png) [@AiVeR](https://forums.unrealengine.com/u/AiVeR)\
**Post date:** [March 15, 2017, 1:59pm UTC](https://forums.unrealengine.com/t/variables-in-behaviour-tree-task/387996/1 "2017-03-15T13:59:52Z")

</div>

Hi!

I have my blueprint task and not editable variable in it. On task execution I increment this variable and finish task. On the second run of same task looks like this variable has not default value, but incremented. Is it true that variables in tasks are static? Can I make them non-static? Thank you!

Regards,  
Ivan

---

<div class="post-metadata">

**Author:** ![MieszkoZ](https://d3kjluh73b9h9o.cloudfront.net/original/4X/2/8/5/28502927f1d97ba1051b3b47ccfe17233bf41ef0.png) [@MieszkoZ](https://forums.unrealengine.com/u/MieszkoZ)\
**Post date:** [March 15, 2017, 7:45pm UTC](https://forums.unrealengine.com/t/variables-in-behaviour-tree-task/387996/2 "2017-03-15T19:45:38Z")

</div>

Tasks are not getting destroyed when they finish execution so all changes to BP’s variable values persist between runs. You can always manually reset values of the variables as part of `ReceiveExecute` handling.

Cheers,

–mieszko

---

<div class="post-metadata">

**Author:** ![AiVeR](https://d3kjluh73b9h9o.cloudfront.net/original/4X/2/8/5/28502927f1d97ba1051b3b47ccfe17233bf41ef0.png) [@AiVeR](https://forums.unrealengine.com/u/AiVeR)\
**Post date:** [March 16, 2017, 8:50am UTC](https://forums.unrealengine.com/t/variables-in-behaviour-tree-task/387996/3 "2017-03-16T08:50:36Z")

</div>

Thank you for explanation!

Regards,  
Ivan
