The problem occurs when starting the game in the packed version (message copied from the packaging logfile):
Message dialog closed, result: Ok, title: The UE5-DF5 Game has crashed and will close, text: Assertion failed: (Index >= 0) & (Index < ArrayNum) [File:D:\build++UE5\Sync\Engine\Source\Runtime\Core\Public\Containers\Array.h] [Line: 691]
Array index out of bounds: 0 from an array of size 0
Background:
The game is running well in Unreal4.27.2 both in editor and packaged.
It is created in blueprints.
The migration to Inreal5 was nearly perfect. There are some warnings about UIWS, but everythings worked fine. The game is running well in the editor.
I solved the usual packaging problem (copying a visual studio file).
Now the packaged game always crashed on start.
I can package it in debug version and write text to the logfile via prints.
These logs then make visible that my code in the game instance (Init) is completed. Afterwards the player character etc should be allocated by the system. But then it crashes.
So the array that is empty (this is what the message says) isn’t one of my arrays.
To solve that I created a new project (just ThirdPerson). That tiny project can be packed and works of course.
I then migrated the map of my game into that new project.
I then changed the starting map.
Until here it works.
When I replace the GameInstance with my Blueprint the packaged version crashes.
Some ideas what this could cause?