Need help with stick C4/bomb

i keep getting this error

InvalidCastException: Cannot cast from source type to destination type.
StickyC4+$Fire$5+$.MoveNext () (at Assets/Script/StickyC4.js:22)

with this script

var radius : float = 5.0;
var power : float = 10.0;
var explosiveLift : float = 1.0;
var explosiveDelay : float = 5.0;
var explosivePrefab : Transform;
var explosiveSound : AudioClip;



function Start () {

}

function Update () {
	Fire ();
}

function Fire (){
		yield WaitForSeconds(explosiveDelay);
		var C4Origin : Vector3 = transform.position;
		var colliders : Collider[] = Physics.OverlapSphere(C4Origin, radius);
		var e : Transform = Instantiate(explosivePrefab, transform.position, transform.rotation);
		Destroy(e.gameObject, 2);
	for(var hit : Collider in colliders){
			if(hit.rigidbody){
				hit.rigidbody.AddExplosionForce(power, C4Origin, radius, explosiveLift);
				//AudioSource.PlayClipAtPoint(explosiveSound, transform.position, 1);
				}
			}
}

function OnCollisionEnter(col : Collision){
	var C4 = gameObject.AddComponent(FixedJoint);
	C4.connectedBody = col.rigidbaby;
	}

any help would be great

Instantiate() only returns an universal object of the type “Object” and you have to manually cast it to the type “Transform”.
I think in unity script casting works like this:

        var e : Transform = Instantiate(explosivePrefab, transform.position, transform.rotation) as Transform;

further reading:

still getting

InvalidCastException: Cannot cast from source type to destination type.
StickyC4+$Fire$5+$.MoveNext () (at Assets/Script/StickyC4.js:22)