Array Out of Bounds Error Crashing the Game. HELP !

This is the error I’m facing. Thrown by both Standalone mode and Build Packaged Game (but not in PIE)

So I tried to debug all the new BPs I made and nothing helped. I even removed the need for Arrays and used Select nodes in all the BPs that were made recently in the 2 weeks since I last packaged this game.

Then I noticed, that this crash occurs when I’m directly opening any level (including the simple test level with very few actors OR my story levels which are heavy). This crash DOES NOT happen when I open my main menu, which is a dedicated level with 3D widgets.

Difference was - Main Menu and other levels have different game modes. Main menu has a game mode that DOES NOT contain the PlayerCharacterBP. So I tried that one. Removed the PlayerCharacterBP from my test level’s game mode (which is also used in other levels since it’s the actual reqd game mode, but not by the main menu)

And it worked. No crashes on standalone. Totally bizarre and strange.
Leading me to confirm that it indeed is the PlayerBP that’s the culprit.

It says -1 from an array of size 4 but I don’t have a single Array var in my PlayerBP.

I reverted all LOD/Groom Comp based changes that I did in the past 2 weeks, but nothing helped. (I never suspected that they were the issue since it was all LOD and visibility based changes, again no arrays).

Can anyone please help me diagnose this? It’s really frustrating.

Are you using any struct variables? I’ve had bugged out structs that cause engine crashes for no reason. I inadvertently found these by just deleting them and then just typing them back out. For each loops running through any indexes?

Maybe try checking out any portion of the player character that has multiple indexes for things like materials or stuff like that. Could be simply be a lost pointer from not fixing up redirectors in your content folder. I’m just spit balling here on all this. Surely when packaging it’s throwing up some warnings somewhere you can look?

1 Like

Sadly no. Nothing of that sort. My player has no direct struct var in use. And the only ones that I am using are related to weapon and have been in the game since the beginning. The crazy point is, if Player is the culprit, how can I debug this issue if its not happening in the editor.

No, no such For loops in the player either. My player BP is simple and only has necessary logic.

Player is based on Metahumans and ofc they have their own materials etc but that has no relevance I feel because they have been the same since the beginning and never had a crash.

I did check the packaging log (tried filtering using keywords like Array or Error) but nothing came out of it. Even running in PIE shows no errors in log. I can check the crash log from standalone.

This is way too confusing and somehow this error just summoned itself here.

Are you using any struct variables? I’ve had bugged out structs that cause engine crashes for no reason. I inadvertently found these by just deleting them and then just typing them back out. For each loops running through any indexes?

Maybe try checking out any portion of the player character that has multiple indexes for things like materials or stuff like that. Could be simply be a lost pointer from not fixing up redirectors in your content folder. I’m just spit balling here on all this. Surely when packaging it’s throwing up some warnings somewhere you can look?

Dude you just copy pasted @Humanasset 's reply.

Edit - FIXED ! - Replacing the Pawn from my Char to Default Manny UE5 TP Char resulted in no crash. What I then did, was to delete all SK Mesh components and run the player naked. Which worked, that means the meshes have somehow corrupted their skin cache (given that is the top most error in the stack). Then, I removed all parts of the Metahuman (face, feet, torso, and legs) leaving only the body mesh, and it crashed. I removed the Body Mesh and set it to none, IT DID NOT CRASH !

This simply proved the theory that it indeed was the Body Skeletal Mesh. It works when all Components are there EXCEPT the body mesh of this Metahuman. Okay so how I solved it? I slowly chipped away all the details and it came down to 2 things. Ray Tracing Support being enabled, and GPU Skin Cache being Enabled on Body Skeletal Mesh, somehow both fighting for something.

Ran tests with each of them toggled On/Off one by one and it turns out, it has to be a bug or something, but with Ray Tracing Enabled, it’s crashing no matter you turn SkinCache enabled or disabled. Turning RT off in Project settings fixes this. After which you can enable or disable skin cache (which is useless as skin cache depends on RT being enabled). Idk, I’m not a backend Engineer for Unreal but this makes no sense to me. It never used to crash and now it is crashing even though I had RT enabled from the beginning. For me it’s not that big of a deal as it’s my first game and I don’t have highly reflective surfaces to utilise RT and software shadows look good already with Lumen GI.

1 Like

That’s good to hear. Those metahumans are super intensive on pretty much anything especially when hair is involved lol. I use the same approach sometimes by just going through things and undoing them until it works. Things absolutely do get messed up for literally no reason sometimes. But I’m glad you fixed it.

1 Like

Yeah. Thanks

This topic was automatically closed 30 days after the last reply. New replies are no longer allowed.