So far, we have learned how to create variables and we have written all of them at the beginning of the script. This is where most of the variables will be written, but it's not the only place where we can write them. You will be declaring and using variables in many places in a script. The variables that I have shown you so far are called member variables. These member variables are the only variables that have the option of being displayed in the Inspector
panel or being accessed by other scripts.
Note
Declaring your member variables at the beginning of a class may give you a mental clue that these member variables can be used anywhere in the script.
We will also be creating variables in methods. These variables are called local variables. They are never displayed in the Unity's Inspector
panel, nor can they be accessed by other scripts. This brings us to another concept of programming, called variable scope.