The GS API is added to the Unity project as in the image, and everything works.
Suddenly I noted that every time I load a new scene, the object persists, even if it is not expected to live on that scene.
That would not be a big problem, but the fact is that each time the user goes back to the main scene, the menu scene, where the GS API is located, the scene brings up a new object and the API remains duplicated (as in the second image, taken runtime)
What is the correct way to use the API without duplicate it?
Beppi Menozzi
Hi there.
The GS API is added to the Unity project as in the image, and everything works.
Suddenly I noted that every time I load a new scene, the object persists, even if it is not expected to live on that scene.
That would not be a big problem, but the fact is that each time the user goes back to the main scene, the menu scene, where the GS API is located, the scene brings up a new object and the API remains duplicated (as in the second image, taken runtime)
What is the correct way to use the API without duplicate it?
Hi Beppi,
I would suggest putting that gameobject in a preload scene that your user never returns to.
It uses DontDestroyOnLoad to persist through scenes as you'll always need it for the GS connection.
Thanks,
Oisin.
Customer Support
Hi Beppi,
I would suggest putting that gameobject in a preload scene that your user never returns to.
It uses DontDestroyOnLoad to persist through scenes as you'll always need it for the GS connection.
Thanks,
Oisin.
-
Documentation Notes
-
Design issues with user events
-
Using NoSQL
-
Runtime Collections vs Metadata Collections
-
Anonymous authentication from browser app
-
Modules
-
Movement With Unity
-
Problem with url parameters for downloadables
-
Querying NoSql GameSparks database
-
Challenge accesType
See all 2487 topics