I need help with an impossible crash that happens with Variant Managers.
Summary:
On Event BeginPlay, I load a Variant Manager and activate some Variant. All works fine the first time I load a level, but the second time I load the level, it crashes. This happens both in a Packaged Project and in Editor ‘Standalone Game’.
So the sequence is:
- Begin Play is successful the first time. VariantManagers load as they should.
- Navigate to another level, all is good.
- Go back to the first level, instant crash.
However:
- If I load the Variant Manager but don’t apply a Variant, no crash.
- If I load the Variant Manager, delay 2secs and then apply a Variant, no crash
- If I run in PIE, no crash
What can possibly be happening here? Is there an invalid reference to VariantManager that fails when accessed on second-level-load? How can I possibly investigate this further? I would make a bug report, but it’s so hard to replicate this issue..
Crash reports different things at different times, but usually related to an array, when accessing
UnrealEditor_VariantManagerContent:
Assertion failed: (Index >= 0) & (Index < ArrayNum) [File:D:\build\++UE5\Sync\Engine\Source\Runtime\Core\Public\Containers\Array.h] [Line: 758] Array index out of bounds: -2146525327 into an array of size 0
Assertion failed: Index >= 0 [File:D:\build\++UE5\Sync\Engine\Source\Runtime\CoreUObject\Public\UObject\UObjectArray.h] [Line: 868]
Assertion failed: this [File:D:\build\++UE5\Sync\Engine\Source\Runtime\CoreUObject\Private\UObject\Class.cpp] [Line: 2432]