Machinegun built on particle emitter (world collisions enabled) behave unreliably

Hi,
My machinegun mechanics based on Particle System (world collisions enabled, collision quality set to High) behave unreliably for some reason. Machineguns sometimes work flawlessly… and sometimes not at all (particles start to go through everything). Any tips on what may be happening here or how to go about tracking this issue down?


You may take a look yourself how it behaves in this build:
(click to run in browser)

(unity version 5.0.1f1)

I noticed that this happens when particles from this ParticleSystem are spread out on scene too much

I am pretty sure unity automatically drops collision quality on particles if things are getting “busy”. So using particles as projectiles might not be your best option.

1 Like

Is there a way to override this one particular behavior somehow? Because it’s incredibly easy and fun to make things like machineguns etc. using ParticleSystem since messages OnParticleCollision were introduced.

But why not just use a raycast or rigidbody? The only time I use particles collisions for projectiles if in the case of flamethrower like weapons.

Yes, raycasts are certainly efficient a way of doing this. But I would love to have bullets visibly flying around (meaning: slower than light speed) and there this slow-motion aspect in this game which makes it harder to fake/predetermine collisions precisely.
I can see that static meshes wouldn’t be a problem; just simple calculation of a hit delay from distance/speed. But I’m not sure how to obtain precise results when considering moving objects (which could obscure line of flight x time after initial raycast). Still seems possible but rather complicated (?)

So why not use a rigidbody bullet?

That’s right. This is what I’ll probably end up doing here :T
I’m thinking about implementing this as a pool of invisible ridigbody spheres + ParticleSystem to serve merely as a renderer for them all. Pity that ParticleSystem can’t handle this tho; it almost works.