📜  如何在ue4 c++代码示例中获取玩家视点位置和旋转

📅  最后修改于: 2022-03-11 14:44:52.373000             🧑  作者: Mango

代码示例1
#include "GameFrameworks/PlayerController.h"


void YourFunction(int32 yourargument)//note: The return type and the argument tupe is assumed. You can change it to whatever you want.
{
    FVector PlayerViewPointLocation;
      FRotator PlayerViewPointLocation;
  
      APlayerController::GetPlayerViewPoint(OUT PlayerViewPointLocation, OUT PlayerViewPointLocation); //Note: You can also use GetWorld()->GetPlayerController()->GetPlayerViewPointLocation() but you have to include the file given above.
      
}