# How to get current state of AI state tree?

**URL:** <https://forums.unrealengine.com/t/how-to-get-current-state-of-ai-state-tree/2737850>\
**Category:** AI\
**Tags:** unreal-engine, question\
**Created:** [July 23, 2026, 3:21pm UTC](https://forums.unrealengine.com/t/how-to-get-current-state-of-ai-state-tree/2737850 "2026-07-23T15:21:21Z")\
**Posts on this page:** 2\
**Page:** 1

<div class="post-metadata">

**Author:** ![gantoine](https://d3kjluh73b9h9o.cloudfront.net/original/4X/2/8/5/28502927f1d97ba1051b3b47ccfe17233bf41ef0.png) [@gantoine](https://forums.unrealengine.com/u/gantoine)\
**Post date:** [July 23, 2026, 3:21pm UTC](https://forums.unrealengine.com/t/how-to-get-current-state-of-ai-state-tree/2737850/1 "2026-07-23T15:21:21Z")

</div>

Hello,

I am working in an actor blueprint and want to query the current state of its AI State Tree so I can perform the correct logic. How do I accomplish this?

Cheers

---

<div class="post-metadata">

**Author:** ![ShadowBr0kerz](https://d1ap1mz92jnks1.cloudfront.net/user_avatar/forums.unrealengine.com/shadowbr0kerz/32/1201558_2.png) [@ShadowBr0kerz](https://forums.unrealengine.com/u/ShadowBr0kerz)\
**Post date:** [September 11, 2026, 7:35pm UTC](https://forums.unrealengine.com/t/how-to-get-current-state-of-ai-state-tree/2737850/2 "2026-09-11T19:35:13Z")

</div>

there is no built-in “get current state” blueprint node, which is why you are hitting a wall. what exists:

1. UStateTreeComponent (or the AI one: UAIStateTreeComponent… on pawns it usually lives as “StateTree” on the StateTreeAIComponent) exposes GetInstanceState / the runtime context — in C++ that is FStateTreeExecutionContext with CurrentState. Blueprint exposure is thin, so the practical BP route is a comparer/evaluator.
2. the intended BP pattern is a StateTreeComparer: StateTree instances support Comparers (FStateTreeInstanceComparer) — you implement one that hashes the current state (GetInstanceState → state name as FName) and then QueryInstance for it elsewhere. Epic’s sample uses this for “is the character doing X” checks. still C+±ish work but it is the sanctioned path.
3. the zero-code workaround most people ship: mirror the state. add an instance data property (e.g. CurrentStateName as FName) on the actor, and in every state that matters add a tiny task (or a transition condition evaluation) that writes a literal into it. two extra nodes per state, and any blueprint on the actor can read the variable. it cannot go out of sync in the states that write it — and you only need to instrument the states you actually branch on, not the whole tree.
4. if you want reactive behavior rather than polling: transitions ARE the reactive layer — instead of “other logic reads state and reacts,” add transitions from each state on the events/conditions that should interrupt. behavior-tree-minded people poll; StateTree-minded people add transitions. going full event-driven usually removes the need to query the state at all.  
for a quick BP-only answer: option 3 today, or one small C++ comparer if this is a long-lived project.
