Hi,
I’m trying to figure out how to call a function from another script. Something that works like a .h file in c++.
Basically, I have a script(main.js) with a function called character_jump() ; then I have another script(myGUI.js) with a gui that needs to call that function. Is there a way to link separate js files together?
I’ve tried using GameObject.GetComponent but that it’s not working out for me.
Here’s a snippet:
var ref : main = gameObject.GetComponent(main);
...
function button()
{
ref.character_jumping();
}
Thanks in advance.
-Hakimo