Hello
The most likely reason is that this code is being called multiple times
Are you calling this from a method that is called multiple times (like a monobehaviour ‘Update’)?
It likely works as expected the first time but subsequent calls happen as the original operation isn’t completed and you get the error “The Player is already signing in.”
I get false every time I check if a user is signed in, even if it says “The player is already signed in” I have a few scripts that check if a key exists or save an object to Cloud Save and this code is in the Awake or Start methods.
Is this the only place in your project where you call the signin method?
Is there only one instance of that monbehaviour in your scene(s)?
Can you provide more of your sample code?
So I have a cloud save script that checks if a key exists and I do this multiple times. I also do this for saving stuff to cloud save which is done multiple times.
public async override void OnEnter()
{
await UnityServices.InitializeAsync();
bool isSignedIn = AuthenticationService.Instance.IsSignedIn;
Debug.Log($"Is Signed In:{isSignedIn}");
if (!isSignedIn)
{
await AuthenticationService.Instance.SignInAnonymouslyAsync();
}
if (!key.IsNone && !key.Value.Equals(""))
{
await ListAllKeys();
}
}