UFSM: Finite State Machine

Try change the source code of “Make States” function to something like this and see if the problem still persist:



void UStateMachineComponent::MakeStates(const TArray<FName> &NewStates, FSM_Transition &Transition) {
    if (NewStates.Num()==0) {
        Transition = FSM_Transition::Aborted;
        LOG_FSM(Debug,GetOwner(),this,ESeverity::Error,FString("'New States' Array is zero sized."));
        LOG_PIE(Debug,ESeverity::Error,this,FFIND(TEXT("MakeStates")),FString("'New States' Array is zero sized."));
    return;}
    //
    for (auto &State : STATE) {
        State.Value.OnBeginState.Clear();
        State.Value.OnUpdateState.Clear();
        State.Value.OnExitState.Clear();
    } STATE.Empty();
    //
    for (int32 I=0; I<NewStates.Num(); I++) {
        if (!NewStates*.IsValid()) {LOG_PIE(Debug,ESeverity::Error,this,FFIND(TEXT("MakeStates")),FString::Printf(TEXT("Name for generated State of index {&i} is invalid."),I)); continue;}
        if (NewStates*.IsNone()) {LOG_PIE(Debug,ESeverity::Error,this,FFIND(TEXT("MakeStates")),FString::Printf(TEXT("Name for generated State of index {&i} is invalid."),I)); continue;}
        STATE.Add(I,NewStates*);
        STATE*.Owner = this;
    } Transition = FSM_Transition::Succeeded;
    //
    LinkStates();
}


If still the same, might be something hidden inside State struct constructor.