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 APlayerController &42; GetPlayerController
&40;
const UObject &42; WorldContextObject,
int32 PlayerIndex
&41;
Remarks
Returns the player controller found while iterating through the local and available remote player controllers. On a network client, this will only include local players as remote player controllers are not available. The index will be consistent as long as no new players join or leave, but it will not be the same across different clients and servers.
Parameters
Name | Description |
---|---|
PlayerIndex | Index in the player controller list, starting first with local players and then available remote ones |