I want to move "AActor" with "AAIController::MoveToLocation"

How do I implement this.
I could get an AActor instance for moving it.

AController* controller = Cast(actor); //nothing
if (controller) {
APawn* pawn = controller->GetPawn();
if (pawn) {
AController* controller2 = pawn->GetController();
if (controller2) {
GEngine->AddOnScreenDebugMessage(-1, 15.0f, FColor::Blue, TEXT(“### ai found”));
AAIController* aiController = Cast (controller2);
const FVector Location = { 2700, 2000,300 };
aiController->MoveToLocation(Location, 10.0f);
}
else {
GEngine->AddOnScreenDebugMessage(-1, 15.0f, FColor::Red, TEXT(“### ai does not exists.”));
}
}
else {
GEngine->AddOnScreenDebugMessage(-1, 15.0f, FColor::Red, TEXT(“### pawn does not exists.”));
}
}
else {
GEngine->AddOnScreenDebugMessage(-1, 15.0f, FColor::Red, TEXT(“### contoroller does not exists.”));
}

It does not work.
compile error at line 8

It could done what I wnat.
I did the AI controller process on Blueprint.
And I used a call back method for Blueprint with coordinates for moving as argument