ATank only works with Cast?

Hey…

my solution works fine with

AActor * GetPlayerTank() const; // header file

and then

AActor* ATankAIController::GetPlayerTank() const
{
auto PlayerTank = GetWorld()->GetFirstPlayerController()->GetPawn();
return PlayerTank;
}

When I change only the AActor* to ATank* it stops working. I thought we declared ATank as an Actor ?! Why does VS throw an error?

Privacy & Terms