- Home /
Particle Colliders and manual particles
I'm not doing anything exceptional here, I just have a particle emitter set up to leave a trail of particles with a collider on them. That all works fine except that the trail is too spuratic when left to the standard emitter.
I set the emitter to have a maximum number of particles 0 so that it would not automatically emit particles, then tell it to emit a particle every fixed update. This gives me great control over the flow of particles from my system, but now the particles don't collide.
I've tested a couple different ways and determined that from the same emitter any particle automatically emitted generates a collision message like it should, but any particle that I manually produce with the Emit() function(in any of it's forms) does not. I have also found that both ways of emitting particles still make the particles bounce on collision like they should.
Has anyone else run into this kind of problem or am I out in left field? Alternative solutions to keeping track of a trail would be interesting as well.
I have exactly the same problem - particles created by assigning to .particles
property don't interact with collider in the same way built-in particles do. They ARE affected by particle collider's properties but don't change their direction (e.g. if bounce factor is set to 10 they will accelerate through the collider).
Have you been able to solve this?
Update: I have rewritten the emission code using particleEmitter.Emit(...)
calls ins$$anonymous$$d of writing to .particles
and it didn't make any difference (but the code looks cleaner).
This is a pretty weird problem- are you animating the particles manually, or are you using a particle animator component? I have a sneaking suspicion that world colliders work by telling the particle animator what to do.
I use particle animator, yes they must be working together somehow. I'm gonna try to change the approach from manual emission to overriding parameters of automatically emitted particles...
Update: my problem seems to have been unrelated to the original question.
I use custom billboarding shaders for particles which assume particles of size 0 (the shader then makes sure the particle is properly resized). It's those particles that go through the colliders.
Setting the particle size to 1e-9
solves the problem for large portion of them, 1e-4
makes most interact with the colliders.
Answer by Bunny83 · Apr 11, 2011 at 01:49 AM
Well, i don't have such problems like you. I didn't worked that much with particles (most of them are created by our artists and i'm the programmer :D). You could keep track of all particles yourself.
ParticleEmitters have a particles property that returns a copy of all particles. You can change everything on this array and if you assign it back to .particles all changes will be "saved". The array holds Particles. If you're good at scripting you can do really awsome things ;)
Good luck
That is basically what I've been doing. The problem is I haven't found what is different about my manual particles from the auto generated ones to control it. Thanks though.