- Home /
Call function in another script?
What do I use to call a function in another script?
Comment
This question has also been asked and answered $$anonymous$$ANY $$anonymous$$ANY $$anonymous$$ANY times before. Execute a search using:
"call function script"
And see if you can count how many times its been asked before.
Best Answer
Answer by burnpsy · Jun 11, 2012 at 01:41 AM
In C#, you call
ScriptName scriptName = this.gameObject.GetComponent<ScriptName>();
under Update() then check/edit stuff under scriptName.whatever. No idea how it works in UnityScript.
Feel free to change this.gameObject to whichever object you attached the code to.