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;
}
}