Hello,
I’m trying to baking a level, but Unreal crashes every time. I know there are many posts on this topic, but I haven’t found one that matches my situation.
I’m getting the following error message:
Assertion failed: (Index >= 0) & (Index < ArrayNum) [File:D:\build++UE5\Sync\Engine\Source\Runtime\Core\Public\Containers\Array.h] [Line: 1067]
Array index out of bounds: 2 into an array of size 2
The error you are getting does pop up from time to time around the community, and the first thing to check is to ensure that your project has “Path Tracing” enable in your settings.
On the other hand, your error states that the array out of bounds has an index 2 into an array of size 2. That suggest that something in your scene, most likely an imported static mesh, has a light map coordinate index set to 2, while having your regular UV channels 0 and 1. Then you try to bake, the engine looks for an inexistent channel 2, and crashes.
A crash log can confirm if this is the case, and should point at which asset is causing the crash. You should be able to find said logs at your project’s Saved/Crashes folder, or at your local machine in C:\Users[Your Windows Username]\AppData\Local[Project Name]\Saved\Crashes.