P
P
p4p2019-05-11 23:50:23
Unity
p4p, 2019-05-11 23:50:23

Full scene unload and clean virgin load, how to do?

I have two scenes
1. Menu
2. Game
1. I load the game from the menu.
2. Then I load the menu from the game.
3. And then I go back to the game and get
a MissingReferenceException: The object of type 'GameObject' has been destroyed but you are still trying to access it.
Your script should either check if it is null or you should not destroy the object.

and it killed my day. I just want to unload the scene and load another one, and then reload the first one - without saving links and stuff. I've tried everything!
1. Deleting all objects on unload
2. UnloadUnusedAssets
3. Force unload
I have 0 dontdestroyonload and I don't want to save anything! How do I clean load a scene that has already been loaded?
I don't want to check for null. Objects don't go anywhere. It turns out refers to the objects that were in the last boot? How to avoid it?

Answer the question

In order to leave comments, you need to log in

Didn't find what you were looking for?

Ask your question

Ask a Question

731 491 924 answers to any question