hello.
I edited the two script.
I want them to call each other variables.
What do I do?
I am a novice to use java script…(
hello.
I edited the two script.
I want them to call each other variables.
What do I do?
I am a novice to use java script…(
Well, if you added these 2 scripts to the same object, you can use SendMessage to call thier public methods (more info see here Unity - Scripting API: GameObject.SendMessage).
But if you want to work with thier variables, you should get the link on scripts before via GetComponent method:
// set link to another script
var other : ScriptName = gameObject.GetComponent(ScriptName);
// set another variable in the other script instance
other.someVariable = 5;
This piece of code from GetComponent method’s description, see full code here: http://docs.unity3d.com/Documentation/ScriptReference/GameObject.GetComponent.html