When object is destroyed, player script doesn't detect OnTriggerExit, or false value on OnTriggerStay

public int health = 25000;
private int healthadd;
public GameObject player;
public Text healths;
public bool infire = true;
public int damage = 1;

	void Start()
	{
		
	}
	void Awake () 
	{
	
	}
	void OnTriggerEnter (Collider start)
	{
		if (start.gameObject.name == "start") 
		{
			infire = false;
		} 
	}
	void OnTriggerStay (Collider start)
	{
		if (start.gameObject.name == "start") 
		{
			infire = false;
		} 

	}
	void OnTriggerExit (Collider start)
	{
		if (start.gameObject.name == "start")
			infire = true;

	}
	void Update() 
	{
		if (health >= 35001) {
			healthadd = 2;
		}
		if (health <= 35000) {
			healthadd = 5;
		}

	
	}
	void FixedUpdate()
	{
		if (health > 999801)
		{
			health = 999801;
		}
		if (infire == false) 
		{
			health += healthadd;
		}
		else  
		{
			health -= 0;
		}
		if(Input.GetKey(KeyCode.LeftShift))
		{
			DamagePlayer(5);
		}
		
		DamagePlayer (1);
		uihealths () ;

		if (health <= 0)
		{
			health = 0;
		} 
	}
	public void DamagePlayer (int damage)
	{
		health -= damage;
	}
	void uihealths () 
	{
		healths.text = "Warmth: " + (health / 50).ToString ();
	}
	
}

My game object “start” has an auto destroy script to destroy itself after 180 seconds, and a collider. The player has a collider, and when a trigger is detected the player gains 50 points of health per second. The problem is when the object destroys itself when the player is inside its collider, my script doesn’t detect that the player has exited the object.

There is a useful function called LateUpdate();

The call order for Unity is

FixedUpdate() → OnTriggerEnter() or OnTriggerStay() or OnTriggerExit() → Update() → LateUpdate()

Since your variable “infire” is global, you could do this

void LateUpdate(){
    infire = false;
}

So at the end of every frame, it will set “infire” to false.

If your “start” object exists, at the beginning of the frame it will change the value of “infire” using one of the Trigger functions you have. Update() will then read “infire” as true, then LateUpdate() will set it to false again.

If your “start” object does not exist, “infire” will not change in value, so it will stay false.