Question by
J3dogs · Dec 06, 2015 at 01:57 PM ·
animationjavascriptscript.variables
assign a new value to a variable
I made this script: #pragma strict var I : int = 0; function Start () {
}
function Update () { if ( Input.GetButtonDown("Fire1")) { if ((I == 0)) { GameObject.Find("Cube").GetComponent.().Play("a"); var I : int = 1; } if ((I == 1)) { GameObject.Find("Cube").GetComponent.().Play("b"); var I : int = 0; } } } The console gives me the following error: Assets/animz.js(18,18): BCE0067: There is already a local variable with the name 'I'. how can I fix?
Comment