Ue4如何在C++中获得获得当前角色的指针?

#include "ThirdPersonPluginCharacter.h"   
#include "Kismet/GameplayStatics.h"

//包含你的角色头文件以及GameplayStatics.h
AThirdPersonPluginCharacter *MyCharacter = Cast<AThirdPersonPluginCharacter>(UGameplayStatics::GetPlayerPawn(this, 0));

if (MyCharacter)
{


}

 

posted @ 2016-02-11 11:45  湛蓝玫瑰  阅读(1537)  评论(0编辑  收藏  举报