Update() doesn't update so well

Hello guys, im new in this forum as with Unity. So the question maybe stupid. The fact is that I got a bool variable that changes depending in which function is running (OnTriggerEnter or OnTriggerExit). I also got a Update() function that returns in console a message or another depending of the previous variable. My problem is that the text message is only changed once, even tough the update is called once per frame… Here is my code:
`var bool=false;

function OnTriggerEnter(other: Collider)
{
if (renderer.material.color==other.renderer.material.color)
{
bool=true;

}

}

function OnTriggerExit(other: Collider)
{
bool=false;

}
function FixedUpdate()
{
if (bool)
{
Debug.Log(‘They are’);
}
else if (!bool)
{
Debug.Log(‘no’);
}

}
` Thank you all in advance.

Your code formatting is very hard to read.

That being said, OnTriggerEnter and OnTriggerExit are only called when a collider enters or exits a trigger. Your console message will only change when either of those events occur. Try moving you collider in and out of the trigger. Or, maybe you’re looking for OnTriggerStay() ?