|
How can i in script A call a custom function in script B, using javascript?
(comments are locked)
|
|
Try this. Script A
Script B:
In this example Script A tells Script B to add 1 to the 'test' integer ever frame. So the syntax is: "nameOfOtherScript.nameOfFunction();" ?
Feb 08 '10 at 12:51 PM
Mattivc
Spot on. With this approach it is in theory (at least) quicker than the GetComponent method, as it doesn't have too look for anything on the initial run.
Feb 08 '10 at 01:00 PM
AquaGeneral
(comments are locked)
|
(comments are locked)
|
|
Use the function GetComponent() to find a script attached to a GameObject.
(comments are locked)
|
