Using ActionBind only while Overlapped

Hello, I want to be able to perform an ActionBind (pressing F for example) only when overlapped with a Trigger Volume.

  void ABooCharacterBase::OnOverlapBegin(class UPrimitiveComponent* OverlappedComp, class AActor* OtherActor, class UPrimitiveComponent* OtherComp, int32 OtherBodyIndex, bool bFromSweep, const FHitResult& SweepResult)
  {
     if (OtherActor && (OtherActor != this) && OtherComp) 
     {
	     Interact();
	     PopUp();
	     GEngine->AddOnScreenDebugMessage(-1, 5.f, FColor::Green, TEXT("Overlap Begin"));
     }
  } 

This is my Interact(); void based on “PlayerInputComponent->BindAction(“Interact”, IE_Pressed, this, &ABooCharacterBase::Interact);”:

 void ABooCharacterBase::Interact() 
 {
     GEngine->AddOnScreenDebugMessage(-1, 5.f, FColor::Blue, TEXT("Pressed F"));
 }

Hope I’ve provided enough information for a solution, thank you for your time.

Solved, I’ve created a bool variable that gets set to true when the player is in a trigger area, to false when it leaves the trigger area. If the bool value is true, then the code in the Interact void can run. Hope it makes sense.