I have a script, with 2 functions. These 2 functions are called at different moments, by another script on another gameObject.
The first function, creates a variable (it's the length of an array that this 1st function creates at runtime using "GameObject.FindGameObjectsWithTag").
I want to use this variable that the 1st function creates in the 2nd function, but when I put it in the 2nd function like this:
while (varName >=1) { ...
I get the error:
"varName" is not a member of 'function ():void'
What should I do then, to use in the 2nd function, the variable that the 1st function creates?