It would be great if we could create and use FSMs for more things than just animation. Say I have a complex UI that has many states and possible transitions, having an FSM enforce valid transitions would be great. This is just one use case, FSMs have many uses, the editor is there so why not extend it so generic FSMs can be created to control whatever developers need and decide FSMs are the best choice to tackle their problem?
I’m currently considering switching over from Unity, so far Unreal Engine comes built in with everything I use that exists in the Unity ecosystem, but I’m a fan of State Machines. Unity doesn’t have a built in generic State Machine editor, but I use an extension called Playmaker and it’s great. I know we can always code an FSM in C++ but having an editor to create and debug it is invaluable.
we really need: State Machines integrated with Behaviour Sub-Trees (Unreal built-in) and integrated with Blueprints Visual Scripting (of course!)… like: NodeCanvas [for unity]
Hmm… Last week I built exactly this for a project.
I made a plugin which generates a custom actor component attached to pawn/character/whatever. the component is a State Machine where I can add/set/remove/tick states with name and machine IDs.
Each State can have function bindings and they can fire OnBeginState, OnUpdateState and OnExitState, and from there I execute the functions I want for when character enters a different state, etc.
It is also exposed to Animation blueprint, and linked to Behavior Tree editor so I can set/add/remove states from Behavior Trees directly…
If Epic consider make a little change in source code someday, then I can also link it to AnimGraph machine states as well.
I could share someday, if I find time to document how to use the custom actor component.
No, not everybody agrees that’s we need anything like PlayMaker in UE4.
It’s inferior, functionality is very limited, it’s primitive tool if you compare it to blueprints.
Of course it would be nice to have to state machine for general use. But often you can use blueprint as workaround. Use Tick and switch on your custom enum (which is controlling loop). Just don’t add any other code to the script which would interfere with you flow controlled by Tick.