Sign In Register

How can we help you today?

Start a new topic

UnitySDK try to connect twice


I have weired problem in UnitySDK (ver

From time to time(not repeatedly), when the sdk is initializing, trying to connect GS server twice.

At that time, I got SessionTerminateMessage because I've put "Spark.getPlayer().disconnect( true );" in AuthenticationResponse for preventing concurrent login.

I attached GameSparksUnity to singleton object. so I think it's not because of duplicated instance.

Is there any something I have to check?

Thank you.


Hi Lee,

It sounds like it could be a duplicate gameObject that contains the GameSparksUnity.cs script in your scene. If you have two of these running at the same time the logs will be similar to the ones you have shared. So I would assume that is what is happening here. At any point in your game do you return to the scene which contains the original "Gamesparks" gameObject which has the GameSparksUnity.cs attached to it ? If so this is also another possible cause. If you initialise GameSparks in a splash screen (or any other screen that the player won't be returning to) it should solve the issue. Try that and let us know if you have any further questions. 



Hi Liam,

I'm sure that it's not a happening from duplicated instance. ( It happens at first scene before change second scene )

I've tried to log call stack where the sdk is trying to connect twice, and I found that both has a different entry point.

Let me show you some logs below.

Login to post a comment