I have an array and a for loop. For every object in the array I want to declare a new variable. How can I do this? I also want it to run without pressing play.
You can’t declare a new variable, only set an existing variable of the object or it’s script.
If you have a variable set to ‘null’, you can use ‘new’ to create an object to set the variable to.
The Editor does not have a simulation mode. Only Play to see how the scene runs.
If you have some sample code, post that to give a better idea of what you need.