Hello, I’ve asked a question here before because I didn’t understand how to link a variable from another script. But my next question is how to get another variable to that script to. By example:
testInput.js
var testVariable = 1; var to : testOutput; // Assign it in the inspector function Update() { if( Input.GetKey("k") ) { testVariable= 5; to.UpdateAnotherVariable( testVariable ); } }
testOutput.js
var anotherVariable = 0; function UpdateAnotherVariable( i : int ) { if( i == 5) { if()// if finalVariable from finalScript.js == 10. (here is the
problem)
anotherVariable = 1; } }
finalScript.js
var finalVariable = 5 function Update { if(finalVariable == 5) { finalVariable = 10; } }
Sorry for all that spaces, but that’s because of a problem with the editor :S.