I would like to get the position of a particle for use in the OnParticleCollision function. I’m trying to create a fountain and I would like to instantiate an object every time a particle hits the ground. My code so far is this:
function OnParticleCollision(other:GameObject)
{
if (other.CompareTag("Floor") )
{
var direction:Vector3 = other.transform.position - transform.position;
var go = Instantiate(bloodSplatter, direction, Quaternion.identity);
}
}
Right now direction returns as the particle emitter’s position. But I would like to get the position of the specific particle that collided with the floor. I’m guessing it would have something to do with looping through the particles array, but I’m not sure. Any help would be greatly appreciated. Thanks!