Can I Use player controller into player state to get a individual player

So basically like the title says is that im making a party game and there are a min of 2 players and a max of 4. I know a few ways to know how many players are in game but I need to specify whos player 1, 2 ,3 ,and 4. So I thought maybe to use player Controllers but thats only for local use and not on a dedicated sever use. But I wanted to know if this works heres a pic to show what im talking about.
Screenshot 2022-08-03 124851

Personally when I make a new game mode I use the onpostlogin event and grab the controller pin and get the player state from that and add it to an array so the game mode always has the player states for each player. You can also cast from that pin to your player controller and add that to an array as well so you have all player stats and controllers

so once I get the index of the player states how do I get a certain index number like how the player controller has. Cuz I need like to know who is player 1,2,3, and 4 individually so I can tag them as the corresponding player numbers.

Oh nvm I got it I did my own way to get a index and it works thanks alot mate

GetPlayerController by index will work even in a online multiplayer game but ONLY for the server or host. Each client can’t use other clients player controllers so it is pointless to try to store it remotely.

If clients need to know the team id or player id of other clients it should be stored in the playerstate.

1 Like