Ok so I have 100 objects in my level. Each one has ScriptA.cs attached and in that script I want to set tempVariableA to something different for each object. How do I do this?
Currently I am trying to attach the scripts in a PostProcessor script which I can do successfully. The scripts do attach the way I want. Same script on each of the 100 objects. But durring this attach process I want to set the tempVariableA in this script to something different for each object.
Can this only be done in run time?
(PostProcessor ?)
Well, if the scripts you are attaching (ScriptA.cs or others ?) do not exist before play, you can only affect their variable during runtime, of course (there is no gameObject yet to be looked in the Inspector).
Is it what you meant ?
No there are 100 objects already in the sceen and when ScriptA.cs attaches I can see it in the editor.
But when I open ScriptA.cs on object 1 and change a variable it changes on all 100 objects. I just want it to change on the 1 object.
You must do this modification by using the Inspector. Modifying the script itself, and the code line will result in modifying all scripts.
Remember that if you set different default values in the script and in the inspector for the same variable, the inspector values will overwrite the script values (only for the gameobjects in this case).