Ue4如何在C++中获得获得当前角色的指针?
#include "ThirdPersonPluginCharacter.h" #include "Kismet/GameplayStatics.h" //包含你的角色头文件以及GameplayStatics.h AThirdPersonPluginCharacter *MyCharacter = Cast<AThirdPersonPluginCharacter>(UGameplayStatics::GetPlayerPawn(this, 0)); if (MyCharacter) { }