x


Particle Emitter crashing!

In an attempt to find my own answer to this question, I have already read that particle emitters can crash when there are too many (see here: http://answers.unity3d.com/questions/7348/particle-emitter-breaks-in-emission-help ) but I'm experiencing something different.

I'll try to be succinct with my details as not to ramble.

I have a Particle Emitter on a ship, it has a script on it that fires the particle emitter. simple stuff.

It also has a Particle Collider, as you can imagine, when it hits a hitbox on the 'enemy' layer, the particle should die. (and later the oncollide event will kill the enemy).

Now when I start the game, you can see the Particle Emitter in the hierarchy, I fire a few times and then as soon as the last particle dies (it doesn't matter how many I shoot) The particle emitter crashes. This same thing happens when I set the Collision Energy Loss at a value > 0.

I imagine lots of people have issues with Particle Emitters / Colliders. So beyond my question, what tools could I use to debug the crashing of a game object?

Thanks for your time.

more ▼

asked Apr 27 '10 at 03:17 AM

Adrian Love gravatar image

Adrian Love
228 4 6 18

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

1 answer: sort voted first

First of all - there are a few main categories of problems which can occur when developing, they are: "Crash", "Freeze / Hang", "Error", or "Unexpected Behaviour".

Don't describe your problem as a crash unless it really is crashing -i.e. causing Unity to unexpectedly terminate (it's kind of disparaging to Unity's reputation!). Particle systems don't crash when there are too many particles, they simply wait until some of the existing particles have died away before more can be created, exactly as intended. This might be unexpected behaviour to you, if you didn't know about this limit.

If your particle system has simply stopped emitting particles when you think it should be, but otherwise the rest of your game is functioning and there are no errors, then your problem falls into the "Unexpected Behaviour" category :-)

So, I'm guessing what you really mean by "crash". Does it just stop emitting? Does the particle system gameobject disappear from the hierarchy? If it disappears, it is most likely because you have set the "Autodestruct" property on your particle animator, either in the editor, or via scripting at some point.

more ▼

answered Apr 27 '10 at 01:03 PM

duck gravatar image

duck ♦♦
41k 92 148 415

Rawr. I swear I checked if auto destruct was the culprit. This also stopped my emitter from dropping from the hierarchy when I use a collision energy loss > 0.

Thanks for helping this newbie out. There wasn't much feedback from unity besides the particle emitter just disappearing from the hierarchy.

And now I know (And knowing is half the battle.) Thanks Duck.

Apr 27 '10 at 02:02 PM Adrian Love
(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:

x1704
x592
x321
x89
x17

asked: Apr 27 '10 at 03:17 AM

Seen: 2143 times

Last Updated: Apr 27 '10 at 03:17 AM