Sign In Register

How can we help you today?

Start a new topic
Answered

API duplicated

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?

png
(52.9 KB)
png
(45.9 KB)

Best Answer

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.

1 Comment

Answer

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.

Login to post a comment