Hi
im trying to set up a script that interacts with unity tho html
i have this is the html that loads my unity
function GetUnity() {
if (typeof unityObject != "undefined") {
return unityObject.getObjectById("unityPlayer");
}
return null;
}
if (typeof unityObject != "undefined") {
unityObject.embedUnity("unityPlayer", "WebPlayer.unity3d", 600, 450, null, null, unityLoaded);
}
function unityLoaded(result) {
if (result.success) {
var unity = result.ref;
var version = unity.GetUnityVersion("3.x.x");
unity.SendMessage("CameraPivot", "MyFunction", "Hello from web!");
}
else {
alert("Please install Unity Web Player!");
}
}
now in my unity project ive attached a script to the CameraPivot object and within the script i have a function called MyFuntion
function MyFunction(param: String)
{
temString = param;
}
now the problem is that temString is always empty? any ideas what im doing wrong
kev