Navigation
API > API/Runtime > API/Runtime/Engine > API/Runtime/Engine/UGameplayStatics
Description
Returns the pawn for the player controller at the specified player index, will return null if the pawn is not a character. This will not include characters of remote clients with no available player controller, you can iterate the PlayerStates list for that.
| Name | GetPlayerCharacter |
| Type | function |
| Header File | /Engine/Source/Runtime/Engine/Classes/Kismet/GameplayStatics.h |
| Include Path | #include "Kismet/GameplayStatics.h" |
| Source | /Engine/Source/Runtime/Engine/Private/GameplayStatics.cpp |
UFUNCTION (BlueprintPure, Category="Game",
Meta=(WorldContext="WorldContextObject", UnsafeDuringActorConstruction="true"))
static ACharacter * GetPlayerCharacter
(
const UObject * WorldContextObject,
int32 PlayerIndex
)
Parameters
| Name | Remarks |
|---|---|
| PlayerIndex | Index in the player controller list, starting first with local players and then available remote ones |