What does exactly the "FirstPlayerController" mean?

In UE4 APIs, there’s a common Function named GetFirstPlayerController(). But I’m not so sure what is the FirstPlayerController. Which Player is supposed to be the “First Player”? The Player who joined the server at the first moment? Or, the Player who is recieving local input on every individual client device? Or, anything else?
Thanks in advance!

In docs
GetFirstPlayerController() return APlayerController * and


PlayerControllers are used by human players to control Pawns.

ControlRotation (accessed via GetControlRotation()), determines the aiming orientation of the controlled Pawn.

In networked games, PlayerControllers exist on the server for every player-controlled pawn, and also on the controlling client’s machine. They do NOT exist on a client’s machine for pawns controlled by remote players elsewhere on the network.

For more information and special test use/learn this example:

Hope this helps!

If your game isn’t set up for local multiplayer, there will only be one PlayerController on each client, so GetFirstPlayerController() will return the only PlayerController.

You can see the function on line 3203 of Engine/Source/Runtime/Engine/Private/World.cpp - all it does is return the first entry of the PlayerControllerIterator, which iterates through the PlayerControllerList, which should be ordered by the order PlayerControllers are added to the world. For server use, I think you should probably use GetPlayerControllerIterator() directly.

Hi, Andrew, thanks for your answer! But I’d already known exactly what APlayerController is. However, the only confusing thing to me is the FIRST of “GetFirstPlayerController()” is WHICH.