Detect when object in not colliding with collider.

hi frnds

i m wondering, is there any way to detect that object in not colliding.
i m making penalty shootout. so when my ball enters in goal post texture will appear “GOAL”. and when ball is outside of goal post after kick it will display “Miss”

thanx
regards

box collider shown in red.

3562-but.jpg

goal!

3563-notbut.jpg

not goal !

Was mentioned, how to do a timer?

person kicks the ball ... then call this:
Invoke( "DisplayNoGoal" 1.0 );

function goal()
 {
 person does in fact get a goal
 ie the trigger (red) was triggered
 CancelInvoke( "DisplayNoGoal" );
 actually yell "goa"
 }
function DisplayNoGoal()
 {
 display something like you missed!
 }

The only way I could think of checking that an object was NOT colliding is to go through the OnColliderEnter and OnColliderExit and set a flag when you are collided with the thing you want to check.

kind of like

void OnCollisionEnter(Collision collisionInfo)
{
        if (collisionInfo.gameObject.CompareTag("ColliderYouWantToCheck"))
        {
            bool IAmCollidedWithCollider = true;
        }
}
void OnCollisionExit(Collision collisionInfo)
{
        if (collisionInfo.gameObject.CompareTag("ColliderYouWantToCheck"))
        {
            bool IAmCollidedWithCollider = false;
        }
}

That said, that probably isn’t the most efficient way, but it seems like it would work.

What if the ball hits on the GoalPost ans bounces back?
I mean there is no collider/trigger befor the goal post so, if the the ball hits on solid frame of goal post and bounces and returns to the player side, it would be a miss, still not to be counted. How to deal with it?