- Home /
unityobject and webplayer
Heya
For a while now im trying to get input output from a webplayer and a page. im able to invoke js functions with Application.ExternalCall, and im able to load pages and pass params thourgh WWW. info can be found here:http://unity3d.com/support/documentation/Manual/Unity%20Web%20Player%20and%20browser%20communication.html
but im unable or i dont understand how call the webplayer from javascript. (the first example on the page) -
var unity = unityObject.getObjectById("UnityContent"); -> what is unityconetent do i need to change this, im not sure i understand what this represent?
unity.SendMessage("MyObject", "MyFunction", "Hello from a web page!"); -> so i have a unity webplayer, with in a cube with a script with a function "CallMe", so to call that function(within a script which attached to a cube) i use unity.SendMessage("Cube", "CallMe", "some value")??
last question - lets assume i got it working, can i place the java code anywhere on the html page that was generated by unity?
Thanks
Answer by chronos1 · Jun 08, 2011 at 09:02 AM
mmm, if anyone else has some problems with that,
when u build your project unity automaticly build the webplayer under the name unityplayer, anyway:
var unity = unityObject.getObjectById("unityPlayer");
thats how u use it.
Your answer
![](https://koobas.hobune.stream/wayback/20220612101256im_/https://answers.unity.com/themes/thub/images/avi.jpg)
Follow this Question
Related Questions
How can you detect in javascript when UnityObject2 fails to load the unity3d file? 0 Answers
webplayer install progress feedback 0 Answers
unityObject is null 2 Answers
UnityObject2 only for jQuery? 0 Answers
Why can't I build Web Player in Unity while I have no problems with building standalone versions? 2 Answers