Is it possible to start a Javascript attached to and object (Game1) from another script, C# script attached to another Game object (Game2)? How?
You need to make sure that JavaScript file is in your “Standard Assets”, “Pro Standard Assets”, or “Plugin” directory while your C# remains outside of those paths as per: Unity - Scripting API:
The reasons is that this way Unity can pre-compile your JavaScript stuff before the C# so it’s available to be called.
Or, you can ignore all those steps if you need to simply call functions back and forth.
If you use GameObject.SendMessage(“FunctionName”, variableToSend), you can remotely call functions from any script so long as you have a reference to the GameObject containing them.
Ehi thanks!
It works now!