- Home /
Question by
Werit · Nov 21, 2012 at 08:44 PM ·
webplayersendmessage
Error getting Unity object from Web Player for SendMessage
This is in Unity 4.
The following code gives me: Object # has no method 'getObjectById'
function GetUnity() {
if (typeof unityObject != "undefined") {
return unityObject.getObjectById("unityPlayer");
}
return null;
}
Did something change in the new version? unityObject only provides javaInstallDone.
Comment
Have you resolved this issue yet? Could you share your solution?
Answer by Graham-Dunnett · May 13, 2013 at 11:30 AM
getObjectById
is from UnityObject.js
. Unity 4.0 ships with an updated JS hosting script called UnityObject2.js
. The documentation describes a getUnity()
function.
Thanks for the reply. I used u.getUnity.Send$$anonymous$$essage()
as shown here. There was no error in the console (FF / Chrome) but Unity is simply not responding to the request.
Your answer
