- Home /
OnParticleCollision only working for some objects and some particle emitters
I can't get OnParticleCollision to work. Copied and pasted the example code from the unity docs, added the script to the object I was hitting with the particles, and the following happened: When I used the standard asset flame as the particle emitter, I could get OnParticleCollision to work. But then I tried using the lightning emitter from the Procedural Examples folder on asset store, I no longer got collision. Here's my particle collision code:
function OnParticleCollision(GameObject)
{
Destroy( gameObject );
}
No idea what I could be missing. Any help much appreciated. Cheers
Answer by lukewilliams · Feb 20, 2014 at 04:14 PM
I figured out my problem. My particle system needed to have a particle animator with a force applied in some direction. It now works. Thanks for the responses
Answer by GameVortex · Feb 19, 2014 at 02:58 PM
The Particle System needs to have the **Collision section** enabled and the Collision Type at the top of that section set to World instead of Plane.
It doesn't have the particle system component. It's made up of an ellipsoid particle emitter, particle animator, particle renderer and world particle collider. Can I add the particle system without having to 'recreate' the fire?
Could it have something to do with the particles being Shuriken particles and the others legacy? I'm not sure if that is the case, but from what I've seen on the forums as of (well last year) shuriken only supports plane collision, but as i said, that was last year and should have been fixed by now.
That would most likely be the issue then. Shuriken supports plane and world collision no problem. To enable collision for the Legacy particle system the system needs the WorldParticleCollider component attached and the SendCollision$$anonymous$$essage checked. As described in the **manual** and script **reference**.
Your answer

Follow this Question
Related Questions
Particle Collision Problem 2 Answers
Call OnTriggerEnter with a trigger particle? 0 Answers
Shuriken and OnCollisionParticle 1 Answer
How can I get the specific particle of an OnParticleCollision? 0 Answers
OnParticleCollision and Play Audio 2 Answers