[UE4]APlayerController::Possess()用法

一般在GameMode的构造函数中设置了DefaultPawnClass之后就无法再修改DefaultPawn了,如果想在runtime期间修改DefaultPawn,用APlayerController::Possess()

 

 

C++用法:

AController *MyPlayerController;
// It can be your character too. Since the ACharacter class inherits from APawn
APawn *MyPawn; 
MyPlayerController->Possess(MyPawn);

 

蓝图用法:

https://docs.unrealengine.com/latest/INT/Gameplay/HowTo/PossessPawns/Blueprints/index.html

 

C++ API说明:

https://docs.unrealengine.com/latest/INT/API/Runtime/Engine/GameFramework/APlayerController/Possess/index.html

你可能感兴趣的:(UnrealEngine)