1//file to include
2#include "Kismet/GameplayStatics.h"
3
4//Syntax
5static APawn * GetPlayerPawn(const UObject * WorldContextObject, int32 PlayerIndex);
6
7//ExampleCode
8APawn* PlayerPawn = UGameplayStatics::GetPlayerPawn(GetWorld(), 0);
9// this is a reference to world | This is the index of player which you want. In this case have written 0 that means the first player
10//For more information vist https://docs.unrealengine.com/en-US/API/Runtime/Engine/Kismet/UGameplayStatics/GetPlayerPawn/index.html