x


Disabling particle collider bounce?

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.

more ▼

asked Feb 17 '10 at 03:26 AM

5parrowhawk_legacy gravatar image

5parrowhawk_legacy
32 1 1 3

(comments are locked)
10|3000 characters needed characters left

2 answers: sort voted first

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.

more ▼

answered Feb 17 '10 at 04:13 AM

Ashkan_gc gravatar image

Ashkan_gc
9.9k 36 59 123

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.

Feb 17 '10 at 05:55 AM 5parrowhawk_legacy

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.

Feb 17 '10 at 06:01 AM 5parrowhawk_legacy

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.

Feb 20 '10 at 04:40 AM Ashkan_gc

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.

Mar 16 '10 at 03:38 PM 5parrowhawk_legacy
(comments are locked)
10|3000 characters needed characters left

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).

more ▼

answered Mar 03 '10 at 12:59 PM

Motionreactor gravatar image

Motionreactor
515 1 5 18

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.

Mar 16 '10 at 03:39 PM 5parrowhawk_legacy
(comments are locked)
10|3000 characters needed characters left
Your answer
toggle preview:

Up to 2 attachments (including images) can be used with a maximum of 524.3 kB each and 1.0 MB total.

Follow this question

By Email:

Once you sign in you will be able to subscribe for any updates here

By RSS:

Answers

Answers and Comments

Topics:

x3661
x928

asked: Feb 17 '10 at 03:26 AM

Seen: 2273 times

Last Updated: Feb 17 '10 at 03:26 AM