x


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.

more ▼

asked Jan 15 '10 at 04:28 PM

Shawn gravatar image

Shawn
323 5 6 13

(comments are locked)
10|3000 characters needed characters left

1 answer: sort voted first

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?

more ▼

answered Jan 15 '10 at 04:39 PM

Lucas Meijer 1 gravatar image

Lucas Meijer 1 ♦♦
7.9k 19 43 85

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

Jan 15 '10 at 09:17 PM Shawn
(comments are locked)
10|3000 characters needed characters left
Your answer
toggle preview:

Up to 2 attachments (including images) can be used with a maximum of 524.3 kB each and 1.0 MB total.

Follow this question

By Email:

Once you sign in you will be able to subscribe for any updates here

By RSS:

Answers

Answers and Comments

Topics:

x590

asked: Jan 15 '10 at 04:28 PM

Seen: 3632 times

Last Updated: Jan 15 '10 at 04:38 PM