Sorry if this is something that’s been asked before, or may be a feature or how it’s intended to work.
But I’m trying to make use of events in states in State Trees in order to go to either the next state or jump to a completely different state.
However what I’ve found is that if a state tree instance receives any other event that what is defined, it jumps back to the root and reevaluates. Below shows what I’ve seen in the rewind debugger.
As you can see STEvent.Character.Revived is the first event it receives, which to me should be fine from a design point of view to have the option to act on that. The revive exit is sent a little later from the animation BP currently bound to a revive state node on exit.
The thing is that event doesn’t exist in this tree, it’s not used for any transition at all. Also when the event I want is sent it’s too late to do anything with it. As the tree has already jumped back to the root and revaluated the tree and selected the node to follow the party leader.
I can think of some potential workarounds to this but it feels weird to have to do so, as if I don’t send this STEvent.Character.Revived event it works as expected. Which is the character stands up, then proceeds to enter the follow state.
Any info on this would be appreciated, just so I know what the best steps to take next would be.
Try adding a Delay (forever) task to that wait for revive state.
When building something like this, I tend to put the event based transition on a parent state that contains child states that has tasks to do dialogue call outs, animation, delays, task to modify health/die… Etc.
Ah, thanks, I’ll give that a try.
Was hoping there wouldn’t be a explicit need to have a task in a state, seeing as it’s possible to enter and remain in a state and have something else switch to another state.
I see what you’re saying… It takes some getting used to. UE state trees are a bit quirky but very powerful and easy to troubleshoot once you figure them out.
My state trees generally always have tasks on the final “leaf” states, if only a delay at times.
Yeah, could be the reason why I’ve had funky issues in other cases where I’ve relied on state tree events.
So something I need to do a sweep of and do some corrections.
Can’t help but still feel like it’s a bit of a bug rather than a quirk, as I use on tick to check a condition to do a transition and that has no problem
Either way, thanks again will be mindful of that “quirk”.