Casting AActor to pawn

You’ve declared the TArray on line 67 as AActor which doesn’t match the APawnAITank* TempAITank when you try to assign it.

I’m 99% sure that if you change the TArray, you won’t need to cast since it will definitely be a type of APawnAITank and can go straight to line 76 with:
TankAIControllerRef = Cast(AITank[i]->GetController());