Let say Object A have attached script A and Object B have attached script B
so how do you access script B function on your script A?
here is how you do it
ScriptA
var other : ScriptB;
function Update () {
ScriptB.run();
}
ScriptB
function run() {
Debug.Log("I RUN RUN RUN");
}
Note: MAKE SURE you drag OBJECT B into your OBJECT A script "Script A" variable "other"
No comments:
Post a Comment