How to identify a player after traveling between two maps?

I want to recover player information after a travel between two maps.

For example between the lobby and the map selected by the user.

The problem is that when changing the map the controllers also change and the playerID of the playerState is not the same before and after the trip.

So I know that I can save information in GameInstance. I know I can save data using SaveGame. But I don’t know who that information belongs to after the trip.

Is there something constant that allows me to identify the players?

Note: I also know that I can save information on the client side. But I prefer to do it on the server side. It’s safer.

Thank you so much!!

Everyone should be given a unique id when first connected.
Should be able to track information based on that.
This is how we handle admins, bans, team kills etc.

The only identifier I know is the playerID.
Is a member of the PlayerState class and PlayerController class.
It is effectively a unique identifier (as long as you don’t change controllers).

However I have three different controllers.
1-I have a controller for the main menu.
2-Another controller for the Lobby
3-Another controller for the GamePlay

So the player changes identifier at least three times before starting to play.

That’s why I can’t tell which is which when the game starts.

How do you do it?
Thank you so much!!

Keep forgetting that new forums combines C++ & Blueprints unless you click on one in particular :stuck_out_tongue:

When a player joins a server, they do so with a unique id of some kind that is then stored in that player’s player state.

What the unique id actually is varies depending on what platform handles the multiplayer validation for the game, if any.
e.g. Players of a Steam based games would connect using their Steam Id.

In C++, you can grab this and convert it to a string easily enough.
To use it in a Blueprint, you will need to expose it yourself or find a third party plugin that does it for you.

1 Like

Thank you very much for solving this doubt.
:heart: