[SOLVED] Google play games service loads a signing in box after every scene switch.

Hello,
As the title proposes, how would I fix this problem? Currently, my project has two scenes, the gameobject that has the google play games api script is located in the first scene. Upon opening the game, the “connecting to plays services” message is prompted (which is good), but after switching to the second scene and coming back to the main scene, the “connecting to plays services” message is prompted again (which is not good). How can I only make it prompt upon opening the game, and not a scene change.

My current code for the api gameobject is:

    public void Start()
    {

        PlayGamesClientConfiguration config = new PlayGamesClientConfiguration.Builder().Build();
        PlayGamesPlatform.InitializeInstance(config);
        PlayGamesPlatform.Activate();

        if (!Social.localUser.authenticated)
            Social.localUser.Authenticate((bool success) => {});
    }

This code is from a post on stack overflow. But it doesn’t seem to affect anything, it still pops up after every scene change.

Is there any other method? Or is there something wrong with my code?.

Please help!

Would using a singleton help? It would allow you to maintain the same object in all the scenes in your game. I didn’t really work with play services, but it should work.

Thank you. This fixed the issue.

1 Like

please share your final script .