Access player location from another actor

Im trying to access the player controllers location inside another actors code using

FVector PlayerLocation = ()->GetFirstPlayerController()->GetActorLocation();

but i get this error

 error C2248: 'AController::GetActorLocation' : cannot access private member declared in class 'AController'

is there a way around it being private?

,

You trying to get location of player controller which does not have location, you should get pawn possessed by that controller first which should be player pawn/character (ACharacter is extended version of APawn and APawn is most basic form of character in the game)

FVector PlayerLocation = ()->GetFirstPlayerController()->GetPawn()->GetActorLocation();

thanks thats exactly what i was looking for, its always those small details that you get stuck on