Hi i have been working on a script that creates a particle emitter when my bullet contacts with anything.
But now i have gotten some wierd error message that i cant really understand.
InvalidCastException: Cannot cast from source type to destination type.
Here is my code by the way.
var explosionPrefab : ParticleEmitter;
function OnCollisionEnter(collision : Collision){
Destroy(gameObject);
var theClonedExplosion : Transform;
theClonedExplosion = Instantiate(explosionPrefab, transform.position, transform.rotation);
}
Anyone got any idea what it means?