Navigation
Unreal Engine C++ API Reference > Runtime > Engine > Kismet > UGameplayStatics
References
Module | Engine |
Header | /Engine/Source/Runtime/Engine/Classes/Kismet/GameplayStatics.h |
Include | #include "Kismet/GameplayStatics.h" |
Source | /Engine/Source/Runtime/Engine/Private/GameplayStatics.cpp |
static ACharacter &42; GetPlayerCharacter
&40;
const UObject &42; WorldContextObject,
int32 PlayerIndex
&41;
Remarks
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.
Parameters
Name | Description |
---|---|
PlayerIndex | Index in the player controller list, starting first with local players and then available remote ones |