I wonder how I can link a script to an other script, and use the variables from that script in other script.
Read the docs: http://unity3d.com/support/documentation/ScriptReference/index.Accessing_Other_Game_Objects.html
–Eric
Thank you man ! You are my new personal hero !
I have a problem ! The script editor don’t recognize “OtherScript” !
A great way to do is to have one script that references all the other scripts like this:
“scriptA.js”
var hello : String ="hello";
“AllScripts.js”
var ScriptA : ScriptA;
“ScriptB.js”
print(AllScripts.ScriptA.hello);
You may go to your AllScripts script in the inspector and click on ScriptA and assign it the script.
You’re not supposed to actually type “OtherScript”, you’re supposed to use the name of the other script.
–Eric
thank you guys ! now it’s working !