# How do you make a particle system collision add a force to an object towards the particle system?

I have a lightning particle that gets shot at the ground. I want the particles to collide with the object they hit and add an upward force. I tried just entering a negative force in the Collider Force tab but it defaults to 0. If anyone knows a way to do this it would be greatly appreciated!

Edit: I want to send the cube in the photo upwards by adding a force on its y-axis. The Particles should remain as they are.

After searching and searching it turns out I needed to toggle the Send Collision Message bool. If anyone is wondering how to get this to work, toggle on this bool in the inspector:

and this is the code I used to get it moving:

void OnParticleCollision(GameObject other)
{
if(other.GetComponent<Rigidbody>() != null)
{
}
}


I hope that what you are trying to achieve is to make the particles bounce back from a surface. I do not think we need collider force for that. Just set bounce value to non zero. That should work.

Simple Reflection

Strictly Upward

If you want the particle rebound to go upward only, use the trigger section just like you would use BoxCollider2D. Use another particle system to send particle upwards.

rebound and upward

I would guess you have to write a script for particle system to fire whenever a collision is detected on the plane. The second alternative sounds cleaner. Just cover up the ground with a lot of light, nobody will notice :)

Good Luck.

Particle system has a list of collision events. This script checks collisions and matches tags. If tags match, then action is executed. Uncomment flag= true if you want only one collisions.

• Hi @suvam0451 thank you very much for taking the time to respond. I guess I wasn't very clear in my question but I've edited my question so you can better understand what I'm asking. Thanks so much :) – JeffBrin Jan 6 at 21:12
• You only want the first particle to affect the cube, right ? Because if all particles start adding velocity, the cube would fly out. – suvam0451 Jan 6 at 21:14
• No, I want all the particles to affect it because it's meant to be an attack that launches another player up in the air. – JeffBrin Jan 6 at 21:32
• got it working, uploading now... – suvam0451 Jan 6 at 21:41
• No problem man. I learnt something new too :). cheers. – suvam0451 Jan 6 at 21:45