This is a followup to my question in the AI support stream, twitch username PandaGod_
I have a few situations regarding standard solider like AI that may be in cover, crouching or in prone. Those states/stances may be sub trees/leafs within a behavior tree. Currently they are separate animation state machines that power locomotion and blend into upper body behavior in the anim blueprint.
My current use case that I don’t handle as cleanly as I like is as follows:
AI is prone on the ground and firing. AI prone subtree is interrupted by a higher priority behavior. The higher priority behavior than executes an action that may or may not play a unique animation. That animation might not be compatible with the prone stance and in theory shouldn’t need to handle all potential stances.
Ideally when the subtree is interrupted I can play the prone to idle transition and switch stances before the behavior starts executing.
I currently execute this by a cease relevance blueprint service that switches a boolean on the anim blueprint that causes the transition anim to play in the state machine. I have to add in a hacky delay to wait for the transition to finish so the new higher priority task doesn’t force a bad blend with its unique animation.
I might be doing this poorly or maybe I need to handle the current animation stance in the higher priority task. In the ideal world the behavior tree doesn’t care about animation what so ever and under the hood the transitions and blends all happen perfectly, but I don’t see how to decouple that logic with the engine as it stands.