I've searched on here for answers on how to update the user's display name with their steam name, but I'm new to coding and can't figure out exactly what to do with the information. Basically I want the display name to be updated with what their steam display name is every time they log in, but I can't figure out how to update the display name with their steam name even once.
Here is my log in code:
void Login() { if (SteamManager.Initialized) { var request = new LoginWithSteamRequest { CreateAccount = true, InfoRequestParameters = new GetPlayerCombinedInfoRequestParams { GetPlayerProfile = true, GetUserAccountInfo = true }, SteamTicket = GetSteamAuthTicket(), }; PlayFabClientAPI.LoginWithSteam(request, OnSuccess, OnError); } }
In the OnSuccess function, it calls the UpdateDisplayName function. I get the error: The name 'SteamName' does not exist in the current context
public void UpdateDisplayName() { var request = new UpdateUserTitleDisplayNameRequest { DisplayName = SteamName, }; PlayFabClientAPI.UpdateUserTitleDisplayName(request, OnDisplayNameUpdate, OnError); }