Inspector not saving value even before run time

i know any change in the inspector during runtime isnt saved but i am talking before runtime i have a color array and its empty and i am trying to set color through the inspector but when i run the game those colors arent assigned and the array remain empty even its shown colors in the inspector

Hello @nozeld,

If you change something during run-time and then stop the game the inspector will reset, but you can keep the changes if you make a prefab during run-time, the prefab will keep everything you changed and when you stop play mode the prefab won’t be affected.

What do you mean by:

Could you show a screenshot or give more details please?

A screenshot would make your question clearer. But here are some things to check:

  1. are you sure it’s the same array you think it is? (i.e. not one that’s on another GO, or has a different name)
  2. are you changing the array somewhere in your script, like in Start? This would override whatever’s in the Inspector.
  3. is it possible your code is reading the array correctly but not setting the colors on the objects/text/whatever correctly? You could print out the names of the colors to console to check this.
  4. do you have more than one copy of the script in the scene? To check this you could print something to console in Start, run the game and make sure it only happens once.