0

I have global variables in a unityscript file. When I put this .js file to a gameobject, the variables from that .js file appear in the Inspector.

Example:

    var code: Code
    var a : int = 100;

    function Start() {
    }

Variables 'code' and 'a' will display in the Inspector with their values.

But when I change their values​​, for example for 'a' variable I set a different value or some variable I give to comments or delete it, the variables will be still displaying in the Inspector without any change. How can I remove or change them?

Example: (I've changed previous code)

    //var code: Code
    var a : int = 50;

    function Start() {
    }

In the Inspectore I will still have 'code' variable and value for 'a' will be 100.

CodeSmile
  • 64,284
  • 20
  • 132
  • 217
Andrew
  • 163
  • 2
  • 3
  • 10
  • Related: [Unity3D, editable global variables?](http://stackoverflow.com/questions/14219314/unity3d-editable-global-variables) – Artjom B. Sep 29 '14 at 15:23
  • 1
    Try giving the value inside `Start()` function. – Jay Kazama Sep 29 '14 at 15:30
  • 1
    Have you saved the file? Also, have you tried selecting something different and then reselecting the object using the script? otherwise is it possible that you are editing a different script? – Botz3000 Sep 30 '14 at 08:43

0 Answers0