Hello,
i want to hit the particles with an Raycast Hit (Shot)? Is this possible? I tryed with OnParticleCollision… but the bullet is to fast for collision.
Here is my code…
var fwd = transform.TransformDirection (Vector3.forward);
if (Physics.Raycast (transform.position, fwd, hit, count*100)) {
//print ("There is something in front of the object!");
// to see wath the ray hits
//print ("Blocked by " + hit.collider.name);
if (hit.collider.name == "Kiste") {
Instantiate (explosion, Vector3(hit.point.x, hit.point.y, hit.point.z) , Quaternion.identity);
Destroy (hit.collider.gameObject);
PlayAudioClip(explosionSound, Vector3.zero, 1.0);
count = 1;
}
}
the particles i can get like this
var particles = RedBubblesEmitterPrefab.particleEmitter.particles;
//print ("particles = " + particles);
for (var i=0; i<particles.Length; i++) {
print(particles[i].position);
}