- Home /
Crash with new Unity web player
I have a web application which has worked fine for months but when I tried using it recently it has been crashing. It is a very hard one to debug because it is causing a hard crash; it crashes the editor. I have narrowed it down to a single line which if commented out prevents the editor from crashing.
gameObject.AddComponent("BoxCollider");
I have no idea why this would be causing a crash? Does anyone have any ideas? This is called inside the Awake() method of a Script.
One thing to note, if I move this code to the Start() method it works fine with no crashes. This does however create an order of operations issue with other systems. If I could get it to work in the Awake() method it would be best.
Answer by Lucas Meijer 1 · Jan 15, 2010 at 04:39 PM
The title says is crashes the webplayer, but your post says it crashes the editor. Which one is it?
In any case, all crashes are bad, and we want to fix them. Could you send us your project (the simpler the better) trough UnityMenu->Help->ReportAProblem?
It was crashing the web player so I loaded it locally in the new editor to take a look at it. It had to upgrade the old project obviously for the new version and then it crashed the entire editor at the same point the web player was crashing.
Here is the exact order of events that cause a crash in pseudo code..
GameObject go = Instanciate any game object; go.AddComponent(myComponent);
where myComponent has an Awake() method that adds a BoxCollider