- Home /
Unity Web Player Crashes On Application.ExternalCall
I was in the middle of a big project when I included an Application.ExternalCall. After which, during live testing on the website, the game crashes. I decided to dig a little further and create a completely new project with the sole intent of testing the ExternalCall procedure.
function OnGUI()
{
if (GUI.Button(Rect(100,100,100,100),'Test')){AttemptTest();}
}
function AttemptTest()
{
Application.ExternalCall('Alrt','This is a test!');
}
Is the only script in the project. It is attached to the main camera. Then, in the .html file, I added this line after both of the other scripts are implemented.
<script type='text/javascript'>function Alrt(val){alert(val);}</script>
I've even tried sourcing to a stored script on the web server as well.
<script type='text/javascript' src='ecall.js'></script>
With everything done above, I verified that my google chrome is up-to-date, as well as my unity web player and unity... After running the new project online, after clicking the button, the webplayer crashes and stops responding. However, if I wait until chrome gives me an option to stop the webplayer, the alert message appears with the 'This is a test!' dialog.
Is this a bug? Or is there something that I'm completely missing?
Alright, so I performed so more testing. It appears to work in Internet Explorer and $$anonymous$$ozilla Firefox. However, It still crashes in Chrome and Opera. Any insight into this issue?
Did you get an answer to this as I'm having the same issue. I'm using Unity 4.6 and have tried IE11, Chrome (crashes), Firefox, Opera (crashes) and Safari (crashes).
No actually, I didn't receive any response from Unity. However, after about two days, I tried again and everything worked... I found it funny that a brand new project was crashing, however, the older one I was working on worked perfectly. Sorry I don't have any ideas on how to help.
I've been playing with this and I've discovered a couple of things. Firstly, it only appears to crash when you call a javascript alert i.e.:
function showAlert(msg) {
alert(msg);
}
and secondly, you can not call either ExternalCall or ExternalEval from within a static function.
Your answer
Follow this Question
Related Questions
Unity webplayer crashing browser when it is loaded and unloaded into a page using JavaScript 0 Answers
Application.ExternalCall crashing webplayer in chrome 0 Answers
Unity Web player crashes every alternate refresh in Chrome 0 Answers
GL build won't run on Chrome 1 Answer
Chrome: Preventing Unity Plugin from Crashing if Multiple Windows w Players opened 0 Answers