Hello, I’m getting a constant crash when trying to select an actor from the outliner, which seems to be coming from the State Tree component.
The crash looks like it’s caused by the FStatetreeExecutionContext class trying to access an array index out of bounds, from the array of states in my tree. This crash is always caused by the class trying to access the index above the array max, regardless of how many states I add/remove.
This is my state tree for context. This seems to happen when I use Linked Asset types in the tree, so it could be related to that.
Does anyone know what the issue could be and how to resolve it?
I’m also getting a crash with linked assets- rest of the tree works fine, but when I tried moving some functionality out to its own tree it all started crashing on me.
Stack trace:
Assertion failed: IsValid() && IsValidIndex(Index) [File:D:\build\++UE5\Sync\Engine\Plugins\Experimental\StructUtils\Source\StructUtils\Public\InstancedStructContainer.h] [Line: 119]
UnrealEditor_StructUtils!FInstancedStructContainer::operator[]() [D:\build\++UE5\Sync\Engine\Plugins\Experimental\StructUtils\Source\StructUtils\Public\InstancedStructContainer.h:119]
UnrealEditor_StateTreeModule!FStateTreeInstanceStorage::GetMutableObject() [D:\build\++UE5\Sync\Engine\Plugins\Runtime\StateTree\Source\StateTreeModule\Public\StateTreeInstanceData.h:162]
UnrealEditor_StateTreeModule!FStateTreeExecutionContext::GetDataView() [D:\build\++UE5\Sync\Engine\Plugins\Runtime\StateTree\Source\StateTreeModule\Private\StateTreeExecutionContext.cpp:950]
UnrealEditor_StateTreeModule!FStateTreeExecutionContext::CopyBatchOnActiveInstances() [D:\build\++UE5\Sync\Engine\Plugins\Runtime\StateTree\Source\StateTreeModule\Private\StateTreeExecutionContext.cpp:1100]
UnrealEditor_StateTreeModule!FStateTreeExecutionContext::StartTemporaryEvaluatorsAndGlobalTasks() [D:\build\++UE5\Sync\Engine\Plugins\Runtime\StateTree\Source\StateTreeModule\Private\StateTreeExecutionContext.cpp:2044]
UnrealEditor_StateTreeModule!FStateTreeExecutionContext::SelectStateInternal() [D:\build\++UE5\Sync\Engine\Plugins\Runtime\StateTree\Source\StateTreeModule\Private\StateTreeExecutionContext.cpp:3156]
UnrealEditor_StateTreeModule!FStateTreeExecutionContext::SelectStateInternal() [D:\build\++UE5\Sync\Engine\Plugins\Runtime\StateTree\Source\StateTreeModule\Private\StateTreeExecutionContext.cpp:3270]
UnrealEditor_StateTreeModule!FStateTreeExecutionContext::SelectStateInternal() [D:\build\++UE5\Sync\Engine\Plugins\Runtime\StateTree\Source\StateTreeModule\Private\StateTreeExecutionContext.cpp:3270]
UnrealEditor_StateTreeModule!FStateTreeExecutionContext::SelectState() [D:\build\++UE5\Sync\Engine\Plugins\Runtime\StateTree\Source\StateTreeModule\Private\StateTreeExecutionContext.cpp:2890]
UnrealEditor_StateTreeModule!FStateTreeExecutionContext::RequestTransition() [D:\build\++UE5\Sync\Engine\Plugins\Runtime\StateTree\Source\StateTreeModule\Private\StateTreeExecutionContext.cpp:2377]
UnrealEditor_StateTreeModule!FStateTreeExecutionContext::TriggerTransitions() [D:\build\++UE5\Sync\Engine\Plugins\Runtime\StateTree\Source\StateTreeModule\Private\StateTreeExecutionContext.cpp:2707]
UnrealEditor_StateTreeModule!FStateTreeExecutionContext::Tick() [D:\build\++UE5\Sync\Engine\Plugins\Runtime\StateTree\Source\StateTreeModule\Private\StateTreeExecutionContext.cpp:473]
UnrealEditor_GameplayStateTreeModule!UStateTreeComponent::TickComponent() [D:\build\++UE5\Sync\Engine\Plugins\Runtime\GameplayStateTree\Source\GameplayStateTreeModule\Private\Components\StateTreeComponent.cpp:110]
UnrealEditor_Engine!UE::Trace::Private::FLogScope::Enter<FMetadataAssetFields>() [D:\build\++UE5\Sync\Engine\Source\Runtime\Engine\Classes\GameFramework\Actor.h:4573]
UnrealEditor_Engine!FActorComponentTickFunction::ExecuteTick() [D:\build\++UE5\Sync\Engine\Source\Runtime\Engine\Private\Components\ActorComponent.cpp:1170]
UnrealEditor_Engine!FTickFunctionTask::DoTask() [D:\build\++UE5\Sync\Engine\Source\Runtime\Engine\Private\TickTaskManager.cpp:278]
UnrealEditor_Engine!TGraphTask<FTickFunctionTask>::ExecuteTask() [D:\build\++UE5\Sync\Engine\Source\Runtime\Core\Public\Async\TaskGraphInterfaces.h:1235]
UnrealEditor_Core!FNamedTaskThread::ProcessTasksNamedThread() [D:\build\++UE5\Sync\Engine\Source\Runtime\Core\Private\Async\TaskGraph.cpp:760]
UnrealEditor_Core!FNamedTaskThread::ProcessTasksUntilIdle() [D:\build\++UE5\Sync\Engine\Source\Runtime\Core\Private\Async\TaskGraph.cpp:662]
UnrealEditor_Engine!FTickTaskSequencer::ReleaseTickGroup() [D:\build\++UE5\Sync\Engine\Source\Runtime\Engine\Private\TickTaskManager.cpp:573]
UnrealEditor_Engine!FTickTaskManager::RunTickGroup() [D:\build\++UE5\Sync\Engine\Source\Runtime\Engine\Private\TickTaskManager.cpp:1583]
UnrealEditor_Engine!UWorld::RunTickGroup() [D:\build\++UE5\Sync\Engine\Source\Runtime\Engine\Private\LevelTick.cpp:772]
UnrealEditor_Engine!UWorld::Tick() [D:\build\++UE5\Sync\Engine\Source\Runtime\Engine\Private\LevelTick.cpp:1514]
UnrealEditor_UnrealEd!UEditorEngine::Tick() [D:\build\++UE5\Sync\Engine\Source\Editor\UnrealEd\Private\EditorEngine.cpp:2015]
UnrealEditor_UnrealEd!UUnrealEdEngine::Tick() [D:\build\++UE5\Sync\Engine\Source\Editor\UnrealEd\Private\UnrealEdEngine.cpp:550]
UnrealEditor!FEngineLoop::Tick() [D:\build\++UE5\Sync\Engine\Source\Runtime\Launch\Private\LaunchEngineLoop.cpp:5921]
UnrealEditor!GuardedMain() [D:\build\++UE5\Sync\Engine\Source\Runtime\Launch\Private\Launch.cpp:180]
UnrealEditor!GuardedMainWrapper() [D:\build\++UE5\Sync\Engine\Source\Runtime\Launch\Private\Windows\LaunchWindows.cpp:118]
UnrealEditor!LaunchWindowsStartup() [D:\build\++UE5\Sync\Engine\Source\Runtime\Launch\Private\Windows\LaunchWindows.cpp:258]
UnrealEditor!WinMain() [D:\build\++UE5\Sync\Engine\Source\Runtime\Launch\Private\Windows\LaunchWindows.cpp:298]
Update: I’ve done some testing and it seems this crash happens if there are global tasks on the child tree.
I’ve put in a bug report, but as a workaround, if you need global tasks on the child tree you can place them on the root and get more or less the same behaviour.