Boolean problem!!

i have a boolean variable, and i want it to turn “true” when objectA is touching objectB, but turn to “false” when its not.
my problem is that when they touch, it turns true, but it wont turn false again once they’re not touching!!

im using " function OnTriggerEnter ".

Basically, you need to check both enter and exit events.

void OnTriggerEnter( Collider other )
{
    isTouching = true;
}

void OnTriggerExit( Collider other )
{
    isTouching = false;
}

You may need to check the collider tag, name or layer to ensure these are the objects you expected.

Thank you so much man!! :wink: