Im making a game in unity and i want the players usernames to be their microsoft username like in minecraft bedrock addition, but i dont know how to do this.
Im making a game in unity and i want the players usernames to be their microsoft username like in minecraft bedrock addition, but i dont know how to do this.
This should work in C#:
string userName = Environment.UserName;
Or this:
string userName = System.Security.Principal.WindowsIdentity.GetCurrent().Name;