I created a new project based on First Person Template and followed the StateTree guide and it crashes when the destroy actor task is executed.
Does anyone know if it is an error in the guide or a bug?
Ver: 5.3
What is the error message?
Assertion failed: IsValid() && IsValidIndex(Index) [File:D:\build\++UE5\Sync\Engine\Plugins\Experimental\StructUtils\Source\StructUtils\Public\InstancedStructContainer.h] [Line: 119]
UnrealEditor_StateTreeModule
UnrealEditor_StateTreeModule
UnrealEditor_StateTreeModule
UnrealEditor_StateTreeModule
UnrealEditor_GameplayStateTreeModule
UnrealEditor_Engine
UnrealEditor_Engine
UnrealEditor_Engine
UnrealEditor_Engine
UnrealEditor_Core
UnrealEditor_Core
UnrealEditor_Engine
UnrealEditor_Engine
UnrealEditor_Engine
UnrealEditor_Engine
UnrealEditor_UnrealEd
UnrealEditor_UnrealEd
UnrealEditor
UnrealEditor
UnrealEditor
UnrealEditor
UnrealEditor
UnrealEditor
kernel32
ntdll
Try to validate it before destroying
I put a breakpoint on the Destroy Actor node, and a Print before it.
The Print works normally
The Destroy Actor after stopping, I made it advance to the next most internal action and the engine closed
I can’t see further inside, I’m using the blueprint that the guide started mentions
This is how it looks in the guide:

Make it like that:

…Send to verify the installation
It passes normally to Destroy Actor, then strangely repeats the flow again, and also reaches Destroy Actor.
Is it still crashes?
How many times is it repeated? Maybe you somehow created a loop, or maybe connected it to tick?
Review your code and compare it to the guide.
As I mentioned, I followed the guide to the letter, I even created a project from scratch to make sure. In version 5.2 it works correctly, only in 5.3 it crashes
Try to reinstall 5.3
If this won’t help, follow this guide:
The error remains the same after reinstalling, after trying other alternatives on how to destroy it without crashing, I discovered how:
- Delete death task (STT_Destroy), only if necessary (in my case that task only destroyed the actor)
- Generate the OnStateTreeRunStatusChange event of the StateTree and use the Succeeded state to do the actor removal
…With this in mind, I assume that the StateTree has a specific process for how it finishes a task, so deleting the actor in a task causes it to lose the internal references (which it needs to complete its task) and crashes.
Well, I guess so, someone more versed in the source code will have a better idea.
I have a small idea why it’s crashing.
The error log, you showed was pointing to Struct. It might be that the problem is Struct “Transition” in Event Exit State.
Can you try to recreate your problem but leave only empty event. Will it crash? If it does it’s 100% a bug, and should be reported.
Thanks, I had the same problem and you fixed it. ![]()
Legend…I’m just getting into using this and I too had the same issue. Maybe Epic should add an addendum to the docs with your findings as yes works perfectly now!
Same problem here, InstancedStructContainer.h line 119 UnrealEditor_StateTreeModule crash.
I’m not destroying any actors with a state tree component, nor am I destroying any state tree components.
Crash happens immediately when pressing begin play. Often I’m able to play in editor once, and then the next time I press play I get the crash.
I am using level streaming. Moving all NPCs with state trees to the persistent level as opposed to a sub level seems to circumvent the crash. The problem is I don’t want them in the persistent level, I want them in a sub level.
Tried placing a bunch of is valid checks everywhere in my AI controller but no dice, still crash. Pretty sure it’s related to level streaming as previously I was not using level streaming and never got this crash.
Edit: It seems that compiling a blueprint, any blueprint, between editor play sessions prevents this crash.


