How to detect the pawn of a targeted player in multiplayer

Remote playercontrollers all have index or ID -1 (remember player index or ID is not the same as playerstate->playerid, thats a different concept)

zero and positive number IDs are only given to players that belong to the machine that’s accessing them, so player index 0 on the client machine will be player index -1 on the server, and all the players that have gamepads or mouse or keyboard on the server will have their own index 0, 1, 2, etc.

so you really cant rely on the player index to identify a player across the network.

but playerstate->playerid is cool because it is the same value replicated across the network for the playerstate’s playercontoller, so the player controller’s ID will not match the same player across network, but the playerstate’s playerid will.

but really you can skip all that complicated mess by focusing on the pawn instead of the playercontroller.