It has more to do with how you create and initialize the arrays than how you change the values. If you’re not intentionally creating/instantiating those arrays anywhere in code, are you perhaps instantiating the object that holds the array? If so, then the clone is probably pointing to the same array in memory when it’s created, and you should probably initialize them in Awake().
Yep, so your code is working exactly as written. That’s what a for loop does: “For every value from 0 to 5, do this thing”. So it will happen to every element in the array. If you just want to access a single element of the array, don’t use a for loop. Just access it by index directly. For example, to set the third element in the array (index 2):
Maybe i explain myself in the wrong way. The problem is that if i change index 2 to be equal to “something” then every array in my object collection will change to that value at index 2!
It sounds like you might have multiple references to the same array, instead of different arrays.
Each array needs to be created with new int or Array.Copy. If you assign the array simply like myArray = someOtherArray, then you haven’t created a new array, you’ve just created a new reference to the same array.