# State Machine in SubAnimInstance interface not working

**URL:** <https://forums.unrealengine.com/t/state-machine-in-subaniminstance-interface-not-working/1247825>\
**Category:** Character & Animation\
**Tags:** unreal-engine, question\
**Created:** [August 2, 2023, 3:55am UTC](https://forums.unrealengine.com/t/state-machine-in-subaniminstance-interface-not-working/1247825 "2023-08-02T03:55:39Z")\
**Posts on this page:** 5\
**Page:** 1

<div class="post-metadata">

**Author:** ![imtrobin2](https://d3kjluh73b9h9o.cloudfront.net/original/4X/2/8/5/28502927f1d97ba1051b3b47ccfe17233bf41ef0.png) [@imtrobin2](https://forums.unrealengine.com/u/imtrobin2)\
**Post date:** [August 2, 2023, 3:55am UTC](https://forums.unrealengine.com/t/state-machine-in-subaniminstance-interface-not-working/1247825/1 "2023-08-02T03:55:39Z")

</div>

Hi, I’m using a animation interface, implemented using a SubAnimInstance. A normal sequence works, but state machine that has logic doesn’t. Is that intended limitation?

 ![image](https://d3kjluh73b9h9o.cloudfront.net/original/4X/8/8/0/8808ca475905c004457e891abf320db6897947de.jpeg)

5.2

---

<div class="post-metadata">

**Author:** ![imtrobin2](https://d3kjluh73b9h9o.cloudfront.net/original/4X/2/8/5/28502927f1d97ba1051b3b47ccfe17233bf41ef0.png) [@imtrobin2](https://forums.unrealengine.com/u/imtrobin2)\
**Post date:** [August 2, 2023, 8:42am UTC](https://forums.unrealengine.com/t/state-machine-in-subaniminstance-interface-not-working/1247825/2 "2023-08-02T08:42:54Z")

</div>

I see in the logs, there is this error spamming

FAnimNode\_StateMachine::Update - Invalid current state, please report. Attempting to use state -1 of 1 in state machine 0 (ptr 0xd5ee56a0

---

<div class="post-metadata">

**Author:** ![Quetzalcodename](https://d3kjluh73b9h9o.cloudfront.net/original/4X/2/8/5/28502927f1d97ba1051b3b47ccfe17233bf41ef0.png) [@Quetzalcodename](https://forums.unrealengine.com/u/Quetzalcodename)\
**Post date:** [August 2, 2023, 10:47am UTC](https://forums.unrealengine.com/t/state-machine-in-subaniminstance-interface-not-working/1247825/3 "2023-08-02T10:47:06Z")

</div>

Hey @imtrobin2!

To help get the ball rolling, would you mind sharing your state machine logic so we can get a better idea of what may be going wrong?

Any additional specifics or information you provide may go a long way in solving your problem!

---

<div class="post-metadata">

**Author:** ![imtrobin2](https://d3kjluh73b9h9o.cloudfront.net/original/4X/2/8/5/28502927f1d97ba1051b3b47ccfe17233bf41ef0.png) [@imtrobin2](https://forums.unrealengine.com/u/imtrobin2)\
**Post date:** [August 3, 2023, 12:50am UTC](https://forums.unrealengine.com/t/state-machine-in-subaniminstance-interface-not-working/1247825/4 "2023-08-03T00:50:17Z")

</div>

I have actually submitted a bug report with reproducible test case. The state machine is just two nodes Idle -\>Walk, with a transition to check speed.

I have tested more since the bug report. It seems that anim layer interface subclass cannot have state machine logic. It works fine for playing anim sequence, which is what all tutorials and epic doc does. I just want to confirm if this is a bug or a known limitation.

In this doc where it talks about Fornite implementation at bottom, it says “the State Machine lives in main graph”, which seems to hint what I’m trying to do is not achieveable.

[Using Animation Blueprint Linking in Unreal Engine | Unreal Engine 5.2 Documentation](https://docs.unrealengine.com/5.2/en-US/using-animation-blueprint-linking-in-unreal-engine/)

---

<div class="post-metadata">

**Author:** ![imtrobin2](https://d3kjluh73b9h9o.cloudfront.net/original/4X/2/8/5/28502927f1d97ba1051b3b47ccfe17233bf41ef0.png) [@imtrobin2](https://forums.unrealengine.com/u/imtrobin2)\
**Post date:** [August 3, 2023, 1:50pm UTC](https://forums.unrealengine.com/t/state-machine-in-subaniminstance-interface-not-working/1247825/5 "2023-08-03T13:50:15Z")

</div>

The case # is 00605336 , you will find the repro project there
