My game crashes consistently with the error cause
Assertion failed: Index >= 0
[File:d:\buildfarm\buildmachine_++ue4+release-4.11\engine\source\runtime\coreuobject\public\uobject\UObjectArray.h]
[Line: 401]
The crash is 100% reproducible, but occurs after an indeterminate period of time, sometimes 10 seconds, sometimes a minute or two - suggesting a race condition perhaps? Running in the debugger from Visual Studio, the cause appears to originate in my HUD Blueprint. This has a Tick event handler which updates on-screen UMG text widgets. There are a set of widgets for each (player) character in the game. The first part of the handler iterates through the players - this appears to work as when I break the link to the next section of the graph, the code runs.
The next section of the graph looks up the player records in the game instance using the name in the player’s widget as a key, then extracts the HP and max HP from that data structure, and stores them in the respective text fields of my HudPlayerStatusBP.
I can prevent the assertion firing by breaking the links to the calls to SetText. The text fields appear to be showing correct values up to that point so I am fairly confident I am not accessing random memory,