! before a function

add this see what it is

GEngine->AddOnScreenDebugMessage(-1, 5.1f, FColor::Green, FString::Printf(TEXT("GetSeeingPawn is a %s"), *this->GetSeeingPawn()));

It is basically scanning all actors and if those 2 things go true you assign whatever that blackboard is and return out of the function and go no farther thru it. If its false it goes until all fors are done then goes to bottom line and finishes, but if you get a true in there anywhere thru the for it will enter set whatever that is and return(break out) and that function is done until called again.

If you used a break enstead of a return it would run the last line when it went true. If you needed that.

This line says this, if object is an actor its true use that if it not and its false use the nullptr.

   return object ?  Cast<AActor>(object) : nullptr;