Got an error message, but cant figure out what it means.

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?

It means that the Instantiation is not returning a Transform - check the documentation

var [COLOR="red"]explosionPrefab [/COLOR]: [COLOR="red"]ParticleEmitter[/COLOR];

function OnCollisionEnter(collision : Collision){		
	Destroy(gameObject);
	
	var [COLOR="lime"]theClonedExplosion [/COLOR]: [COLOR="lime"]Transform[/COLOR];
	[COLOR="lime"]theClonedExplosion [/COLOR]= Instantiate([COLOR="red"]explosionPrefab[/COLOR], transform.position, transform.rotation);
	
	
	}

You are instantiating a ParticleEmitter and trying to store it in a Transform variable. It is not compatible.