- Home /
How to wait for unity webplayer to load and then invoke its function?
SO i tried this by making a call from unity awake/Start function to html javascript
``
Application.ExternalCall( "SayHello", "The game says hello!" ); //void Start
//on html side
<script type="text/javascript" language="javascript">
function SayHello( arg )
{
// show the message
alert( arg );
}
but this externall call never is made for some reason. My browser console says "'UnityObject2' is undefined" eventhough it is defined in html's js and the call from js to unity works fine
when i dont wait and find a way for it to be ready and invoke unity funtion like this
u.getUnity().SendMessage("MyObject", "getCheckpoints", checkpointStringJSON);
it does not send the message firs time but does perfectly the second time. So i am guessing that unity is not loaded the first tie the function is being called.
thanking you in advance
Your answer
Follow this Question
Related Questions
Connecting an html web page with unity web player 0 Answers
How to format Unity's Webplayer 1 Answer
Resize webplayer upon window resize 0 Answers
Why can't I build Web Player in Unity while I have no problems with building standalone versions? 2 Answers
limit to request size via webplayer 0 Answers