- Home /
Particle collision with a rigidbody. Adding explosive force?
Hello. I'm having some trouble adding an explosive force (as in pushing rigidbodies) to a particle system.
The main idea
The particle effect is part of an RPG type ability timed with the animation.
A ring type particle system (player centered) is emitted in a certain radius(achieved);
To give a nice dynamic effect, I had the idea that the particle system (in-game ability graphics) should be more than just graphics and interact with the world around it, playing with collisions and forces.
An example would be: A box is placed in the center of a small area, area that is in the radius of the ability, the ability is activated and the box , and or other dynamic objects in the blast radius, are pushed.
The Logical Procedure
Making a Script that include all particles (only) in that particle
system in an array.Attaching a collider to each particle in the array.
Detecting collision between the particles and rigidbodies and applying the specified force to the objects, like an explosion effect that pushes everything around in its blast radius.
Now figuring this out was the easy part (even if i'm missing some logical steps, if so , my mistake sorry ), but the thing is: isn't this some how simplified in Unity ?
I mean i read about the Rigidbody.AddExplosionForce but I'm still missing something, if you have done something similar and can point me into the right direction please do :)
Thanks in advance.
Answer by jmgek · Jan 22, 2013 at 10:31 PM
Check out detonator its free, and comes with a ton of explosions with the physics built in. If that wont work then let me know.
PERFECT, thanks! Just need to tweak a thing or two but I tested it right out of the box by attaching one of the scripts to the particle system and boom, instant explosion.
Yeah, Also to do area damage you can also input that there.
Really? Affecting multiple npc mobs in radius? I still didn't find that module, which script of the package? thanks again.
Your answer
Follow this Question
Related Questions
Collider question 0 Answers
Reuse a collision 0 Answers
Advice for Intersecting Colliders 0 Answers
Character Controller meets Rigidbody 1 Answer