I am trying to get my Unity web page communicate with Unity. I have this in the web page:
function SaySomethingToUnity()
{
var unity = unityObject.getObjectById(“unityPlayer”);
unity.SendMessage(“MainCamera”, “MyFunction”);
}
I activate the above code with an HTML button.
In Unity my JS file, called GUIButton, attached to the MainCamera object has this code:
function MyFunction()
{
GUI.Button(Rect(10,100,150,30),“From the Web”);
}
When I click the HTML button to activate the JS code, nothing happens. What am I doing wrong?
Thanks,
prof.t.adamson@gmail.com