OnTriggerStay2D not returning false when outside trigger

I have a bool that returns true when the player character is inside the trigger area. I’ve made it public so I can check that it flips. However, when the character exits the trigger, the bool does not flip to false again. Am I missing something here?

	public bool inCover = false; 

	void OnTriggerStay2D (Collider2D other)
	{
		if (other.gameObject.tag=="Player")
		{
			inCover = true; 

		}

		else 
		{ 
			inCover = false; 
		}

	}

this is because you will need to instead call OnTriggerEnter() and OnTriggerExit() to set value true and false. OnTriggerStay() should be used to run logic you only want run while in the trigger, therefore once you leave the trigger
no logic is run and your else statement is never called.