GameObject particleSystemPrefab;
void OnCollisionEnter(Collision collision) {
foreach (ContactPoint contact in collision.contacts) {
//Instantiate your particle system here.
Instantiate(particleSystemPrefab, contact.point, Quaternion.identity)
}
}
This will instantiate a particle system at each contact point but if you want you can instantiate at certain points like only on first contact point or so by writing those conditions.
Since this still shows up early in google I thought I’d add this!
You should avoid instantiating objects as it’s very inefficient. You can get away with it as a one off here and there, but using it regularly (as well as destroying things) will kill your performance.
Use object pooling instead. You have a “pool” of the object in your scene, and just take them from the pool and enable/disable them instead. It’s easy and you can find a great explanation and tutorial on it at https://www.raywenderlich.com/136091/object-pooling-unity