Values in Array Automatically Revert

I am using a for-loop that changes a value of an object in an array of 2D objects, though after exiting the for-loop, the value of the object will revert to how it was before the loop. However, when I put the same type of object into the same for-loop, except where the object is not part of any array, it works as intended, and it's value is not reverted.

The code bellow contains several lines that are unnecessary and could be simplified that I'm aware of; however, I am only focoused on the problem mentioned above, and what exactly the cause of it may be.