- Home /
particle collision
So i have been messing around with particle system, and I have turned on the collision as you can see in the picture:
For the most part the collision is destroying the particles but some how some of the particles magically make it threw the object (and yes the object has a mesh collider) I have tried diffrent kill speeds that doesnt seem to help min on 0 and max speed on 99999 and so on. I tried with bounce on and off dampen on and off nothing seems to make a diffrence. And if particles are make it threw the object that also means some of them wont be caught in the script with
void OnParticleCollision(GameObject other) {
Particle World collision is never meant to be absolutely accurate, ins$$anonymous$$d you should try Plane mode collision. Trigger module is the next best thing, but like plane mode collision, it needs the target colliders to be assigned beforehand.
Answer by Hatdatsat · Sep 26, 2018 at 06:54 AM
Okay i have figured out the problem!
Right now i can use particle speed of 130 without a problem!
The problem is that collision check happens with the fixed update function, and the update doesn't happen often enough.
Because it doesn't happen that often the particle can fly threw the object without the collision being detected so to give unity a change of detecting the collision we need to change 2 values.
The settings that we change to do this can be found at :
Edit -> settings (or project settings) -> Time This is how it looks normally.
The 2 values that i changed fixed timestep and maximum particle timestep (the particle time step cant be lower than fixed timestep so that is why we have to change both, for particle system the maximum particle timestep is important!) With these settings it works for me (less speed means you can probably use lower numbers and higher speeds means you need even more updates so it might be good to test / tweak it for your own project)
@richardkettlewell since you are the person that seems to know a lot about this might be useful info for you aswell since i see your answering a lot about this topic
Just be aware that this change makes the particle simulation run many more times per frame than by default, which can be a large performance difference. At 30fps, it used to run 1 time, now it will run 6 times.
Just be sure to check your performance is still ok :)
PS. Probably you didn't need to change Fixed Timestep, only the particle timestep. Otherwise your physics and FixedUpdate scripts will be much more expensive too, which may not be needed.
If I only change $$anonymous$$aximum Particle Timestep it changes back to the Fixed Timestep the particle timestep cant update more often than the fixed timestep @richardkettlewell
Answer by richardkettlewell · Sep 20, 2018 at 09:16 AM
does the Shape Module cone overlap the cube? If so, maybe the particles that start inside the cube (the top of the cone) never receive a collision event?
What happens if you make sure there is no overlap?
The particle come from the base of the cone (the small part) and the start point is far away enough from The object (have tested it at different distances and it keeps happening) And where the particles hit the object the object is far wider than the cone so they dont go past the object on the sides
ok thanks for the extra info. one other idea (but im sure you checked this) is the cube collider definitely big enough on all 3 axes that no particles miss the cube? If that's not it, I think it's worth submitting a bug report to us for this so we can properly investigate: https://unity3d.com/unity/qa/bug-reporting
I made a clip to show it in action, I think ill have to report the bug because the cubes i have used are native cubes (the 1 in the clip is a cube with texturemap so i can paint each side differently) here is a link to a clip of the bug in action:
the start speed of 40 is interesting. i wonder if lowering that would "fix" it.
Your answer
Follow this Question
Related Questions
Slow Particle Down Inside Collider 1 Answer
Getting the position/intersection of collided particles 1 Answer
Let Particles sit on Collider without triggering callback - OnParticleCollisionEnter? . 1 Answer
How to keep particles moving past an obstacle after they have collided with it? 3 Answers
Particle collision problem 0 Answers