Raycasting Not Working, Failing to turn off a particle system

Well, I finally debugged my script of all syntax errors, yay! However, now it’s just not doing what I want it to.

The goal of my script, is, upon the model looking at it at a distance of 3 units, the fire (Represented by a particle system), will go out. The script, and the particle system itself, is attached to the same model.

The script which details the whole ‘making the fire going out’ thing is here:

using UnityEngine;
using System.Collections;

public class FireManager : MonoBehaviour {
	bool FireIsOn = true;
	float fireTimer = 0.0f;
	public float fireStopTime = 5.0f;
GameObject currentFire;
	// Use this for initialization
	void Start () {
		fireTimer = 0.0f;
	}
	void FireCheck (){
		if(!FireIsOn){
			gameObject.GetComponent<ParticleSystem>().enableEmission = false;
		}
	}
	// Update is called once per frame
	void Update () {
		if (FireIsOn){
			fireTimer += Time.deltaTime;
		}
		if (fireTimer > fireStopTime){
			gameObject.GetComponent<ParticleSystem>().enableEmission = true;
			fireTimer = 0.0f;
		}

		}
}

The other part is in a main script detailing all the collisions the player can make, here’s the fire part of it:

		RaycastHit hitFire;
		if(Physics.Raycast(transform.position, transform.forward, out hitFire, 3)){
			if(hitFire.collider.gameObject.tag == "playerFire"){
				currentFire = hitFire.collider.gameObject;
				currentFire.SendMessage("FireCheck");
			}
		}

So, what have I done in order to result in my script not doing what I intended it to do?

In your FireCheck() method you are only turning off the particle emission if FireIsOn is false, but yet in the code you provided you never actually set it to false. I am guessing that in your update when the timer is greater than the fireStopTime, you may want to set the FireIsOn to false as well? That would allow your “FireCheck” message to turn off the particle if your timer has ran long enough.

Without knowing exactly what you are trying to do and in what way it is not working, that is the best I can do for now.