需要类成员函数下进行,否则GetWorld()会报错 voidAC_Project_001Character::TestFunction() { //1 APlayerController* playerController1 = UGameplayStatics::GetPlayerController(GetWorld(), 0); //2 APlayerController* playerController2 = GetWorld()->GetFirstPlayerController(); }...