InvalidCastException: Cannot cast from source type to destination type.

full error
InvalidCastException: Cannot cast from source type to destination type.
Inventory.LightFire (UnityEngine.GameObject campfire) (at Assets/Scripts/Inventory.js:62)
Inventory.OnControllerColliderHit (UnityEngine.ControllerColliderHit col) (at Assets/Scripts/Inventory.js:53)
UnityEngine.CharacterController:Move(Vector3)
CharacterMotor:UpdateFunction() (at Assets/Standard Assets/Character Controllers/Sources/Scripts/CharacterMotor.js:229)
CharacterMotor:FixedUpdate() (at Assets/Standard Assets/Character Controllers/Sources/Scripts/CharacterMotor.js:331)

    function OnControllerColliderHit(col : ControllerColliderHit){
	if(col.gameObject.name == "campfire"){
		if(haveMatches && !fireLit){
			LightFire(col.gameObject);
		}else if(!haveMatches && !fireLit){
		textHints.SendMessage("ShowHint", "I could use this campfire to signal for help... 

if only i could light it…");
}
}
}

function LightFire(campfire : GameObject){
	var fireEmitters : ParticleEmitter[];
	fireEmitters = campfire.GetComponentsInChildren(ParticleEmitter);
	for(var emitter : ParticleEmitter in fireEmitters){
		emitter.emit = true;
	}
	campfire.audio.Play();
	Destroy(matchGUI);
	haveMatches = false;
	fireLit = true;
}

any ideas

decided to try to build it and it gave me this warning

Assets/Scripts/Inventory.js(62,56): BCW0028: WARNING: Implicit downcast from ‘UnityEngine.Component’ to ‘UnityEngine.ParticleEmitter’.

I’m not 100% sure, but try:

fireEmitters = campfire.GetComponentsInChildren(ParticleEmitter) as ParticleEmitter[];

This looks suspect:

fireEmitters = campfire.gameObject.GetComponentsInChildren(ParticleEmitter)

campfire is already a GameObject, so you should omit the .gameObject part of that line.

var fireEmitters : ParticleEmitter;

var fireEmitters : Component;