UE4 执行Console Command ----ExecuteConsoleCommand

时间:2021-07-22 17:23:31
void UKismetSystemLibrary::ExecuteConsoleCommand(UObject* WorldContextObject, const FString& Command, APlayerController* Player)
{
// First, try routing through the primary player
APlayerController* TargetPC = Player ? Player : UGameplayStatics::GetPlayerController(WorldContextObject, );
if( TargetPC )
{
TargetPC->ConsoleCommand(Command, true);
}
}
ExecuteConsoleCommand