This occurs every tick the state is active and the Delta Seconds from the last tick is passed in. If you manage state updates on your own and don't pass in delta seconds, the state machine instance will attempt to calculate the delta.
Call GetNodeInstance in the local graph to get access to the state instance. This call is equivalent to a self reference in a custom state class and allows you to retrieve variables that the state might set. No cast is necessary, the result is already cast correctly.
Call GetOutgoingTransitions from the state instance to retrieve all outgoing transition instances. This is an array ordered by transition priority and each element will have to be cast to the correct transition class.
Call GetIncomingTransitions from the state instance to retrieve all incoming transition instances. This is an array ordered by transition priority and each element will have to be cast to the correct transition class.
Ensures that the On State Update method is always called at least once before exiting a state. Without this it is possible the update method may not be called in the scenario where a state starts and then on the next tick it completes.
It is possible to nest state machines as many times as you want. Priority is given to the super state so you may want to have transitions leading out of the nested State Machine wait for its completion. There is a helper blueprint node: Is State Machine in End State which is perfect for this, but requires the nested state machine have an end state.
Hierarchical State Machine Example
Super state machine A (super A) changes states to sub state machine B (sub B). Once sub B becomes active it will start the first state of sub B. On the next tick super A transitions are evaluated first. If a transition out is active it will then call On State End on sub B triggering On State End of sub B's nested state.
Shortcut keys can be defined in the BaseEditorPerProjectUserSettings.ini config file, under the LogicDriverSpawnNodes section, to spawn states in Logic Driver state machines. Hold the key down as you left click.
BaseEditorPerProjectUserSettings.ini
[LogicDriverSpawnNodes]# Any state node+Node=(Class=/Script/SMSystem.SMAnyStateInstance Key=A Shift=false Ctrl=false Alt=false)# Standard state+Node=(Class=/Script/SMSystem.SMStateInstance Key=S Shift=false Ctrl=false Alt=false)# Standard state machine+Node=(Class=/Script/SMSystem.SMStateMachineInstance Key=S Shift=true Ctrl=false Alt=false)# Custom blueprint state+Node=(Class=/Game/StateMachines/ClassesRoom/CustomNodes/PrintTextState.PrintTextState_C Key=P Shift=false Ctrl=false Alt=false)# Custom native state+Node=(Class=/Script/SMSystemTests.SMStatePropertyResetTestInstance Key=V Shift=false Ctrl=false Alt=false)