Hi all,
I wonder if there is a way to prevent an object loading more than once.
For example, I have an object loaded in scene A. After loading scene B (object still exists) and going back to scene A again, anoher object is being created.
This is somithing like “quit to main menu”.
if you don’t tell the object to remain loaded, it will actually be killed.
if you tell it to not be unloaded, you can use the start method. check if you find another instance of said object / monobehaviour. if you do, kill the current one through destroyimmediate
ok here is a simple solution:
I check if there is an instance of the object. If not, create an instance.
In this way the object is created only once when the first scene is loaded.