I’m assuming your “Inventory” array does not have 12 items in it. It has less. Say the size of the array is only three, that means you can only access those three members:
Inventory[0] → OK
Inventory[1] → OK
Inventory[2] → OK
Inventory[3] → BAD
Once you start accessing items past the end of the array, you’re accessing memory that is not part of that array (memory that doesn’t have an inventory item stored in it). The crash assert you provided is guarding again you doing it. It’s making sure the index (CheckNum) is within the bounds of your array.
To keep from using an invalid index, you probably want your for loop to look like this:
I just used “12” as demonstration purposes on my original code i do have
Inventory.Num()
but the crash still occurs, it crashes when i use the “CheckNum” inside of the inventory param’s? why?