Does anyone have a good way to prevent particles from bouncing when they collide? I'm trying to make custom collision-handling code - for example, to use particles for armor-piercing bullets, so they should hit the target, go through and hit stuff behind it. The problem is that the particles always bounce off, even when the target is set up as a trigger. Adjusting the Bounce to -1 does nothing. Adjusting it to 0 just makes the bullet disappear.
Answer by Ashkan_gc
Feb 17, 2010 at 04:13 AM
you should set bounce to 0 but when you do this particle will continue collision with the object that you want to go inside so it will loose energy and die. you should make energy loss value a verry small one or even 0 to prevent them to be killed.
Thanks, but I tried using low values or 0 for energy loss, and the particle still disappears. The minimum kill velocity is also set to 0 (I tried -1 but that didn't work either).
My current settings are: bounce factor 0, energy loss 0, min kill velocity 0.
Also, I set up my script to log particle collisions, and when bounce and energy loss are set to 0 then it only logs 1 collision for each particle, not multiple (continued) collisions.
i have no experience using them. it was my guess. sorry if it was not correct. i'll delete the incorrect answer. should i delete it? it's not useful i think.
Nah, I think it's fine. If someone reads this, they'll benefit from knowing that people tried that solution and it didn't work - so it's probably best to leave it visible.
Answer by Motionreactor
Mar 03, 2010 at 12:59 PM
I'd suggest a combination of ray casting for hit detection and particles (without any form of collider) as the visual effect. You don't always have to do things the 'natural logic' way in gaming.
The other technique would be to use prefab bullets and instantiate and add forces to them as if they were like a particle system. The behaviours and scripts would then allow you to do what you wish with the bullets. Particles are a visual effect primarily, not necessarily the right tool for the job at hand (in your case).
Thanks. In the end my particles were slow enough that I could use a simple position/distance check. Not 100% accurate, of course, but close enough, and runs a lot faster than a raycast.
Up to 2 attachments (including images) can be used with a maximum of 524.3 kB each and 1.0 MB total.
The best place to ask and answer questions about development with Unity.
To help users navigate the site we have posted a site navigation guide.
If you are a new user, check out our FAQ for more information.
If you are a moderator, see our Moderator Guidelines page.
We are making improvements to UA, see the list of changes.
Answers and Comments
No one has followed this question yet.
Particles and 2D games
Particle Collision / Trigger not being reported to On_xx Event
How to access particle collision locations
take control over particles
Flame Thrower - Particle Colliders?