Best way to compare actors in C++?

There still seems to be an issue with my comparison. The code compiles fine, still, but the desired behavior isn’t achieved. Perhaps my initialization of the interactingCharacter pointer is incorrect for the context?

void AInteractableObject::interactImplementation()
{
	if (checkingForDirectView)
	{
		ASandboxGameCharacter *interactingCharacter = Cast<ASandboxGameCharacter>(UGameplayStatics::GetPlayerCharacter(GetWorld(), 0));

		if (interactingCharacter->returnRaycastActor() != nullptr)
		{
			if (Cast<AActor>(this) == interactingCharacter->returnRaycastActor())
			{
				Destroy();
			}
		}
	}
}