UFSM: Finite State Machine

Thanks for the reply.
I’m still confused, is it better to not use enums at all if you don’t know all the states from the beginning?
Because, from what I’ve tested, it’s working if I add new states later, directly in the array (in FSM blueprint).

You should edit the list/enum on the attached components, instead of editing the base class asset on content browser.
Usually when you make changes to the enum, you have to remove it from the slot on FSM details panel and then insert it again, because it only detects changes when you “insert a new enum blueprint” to the slot… It can’t detect changes to an enum that was already inserted there.

Maybe I explained it wrong (not native english). I did it like you described: reinserted the updated enum, the list refreshed and the new states were automatically added to the list.
The issue is, that these new states can’t be used (for example Set State function doesn’t work with these new states, as if they don’t exist at all).
Hope it makes sense.

I forgot to add, awesome plugin, It’s amazing how clean my char blueprint is.

Did you compile and save parent blueprint after you rebuilt the state list on the component?
I can’t reproduce the problem you describe there.

So apparently from now on I should use “GetAuthoredNameStringByValue()” function to get enum index as a string.
I don’t know when this was added to the engine, but I didn’t have to use that before… Will submit a plugin update with changes to use that.

Hi!

I am writing rewind mechanichs.
Can i store active states in array with this and than later play them to rewind animations?

There’s no built-in mechanic in the plugin for that.

But if you know what you’re doing, you can easily implement it yourself, creating an array of fsm state sequence since last rewind.

Hello, I bought this plugin and am happy with it. It really is a nice clean and elegant way of scripting stuff. However I have no clue how adding and removing states at runtime could be used? What is it intended for? Thank you

Some projects have runtime level creation tools, they want to add states to things placed by the player.

Thank you for the answer. I also wanted to know, is there a possibility to control tick frequency of a state/function?

Yes, Set Component Tick Interval | Unreal Engine Documentation

That is right, I am using it right now, but I want some states to run every tick. Should I just do a delay node equivalent code inside the function itself?

Not sure what you mean.
FSM state is already running a time counter while that state is active…



Get Time returns the time in seconds that current state has been active.
In a OnUpdateXX state function you can check if ( Time > Y ) → change state.

I see, thank you for explanation

Hi,I try to using the Blueprint Autoflow in C++,but its doesn’t work,in UE5 demo project,its create a child ActorComponent of UStateMachineComponent,it is AutoFlow_API,but in this Component’s head file doesnt have pointer Character,it only use Cast to Owner in FromIdleToRun(),I want to use a pointer to store Character instead of use Cast everytime.or I don’t need AutoFlow_API?I can only use Autoflow in Character C++ Class?if I declare a Character class pointer is will cause circular dependency.sorry for my poor English.

I replied to your same question on Marketplace page.