- Home /
Question by
madhav-aspiration · Jun 27, 2018 at 05:17 AM ·
scripting problemscript.listload scenerestart
Plz Need Help
Error: MissingReferenceException: The object of type 'GameObject' has been destroyed but you are still trying to access it.
i have a static GameObject List when i create object and add this list this is successfully add to list after restrt scene and i am get object from this list so gameobject has destroyed
screen-shot-2018-06-27-at-104203-am.png
(49.1 kB)
screen-shot-2018-06-27-at-104458-am.png
(111.5 kB)
Comment
Answer by Vicarian · Jun 27, 2018 at 05:29 AM
In GameData, in its Awake or Start method, call
DontDestroyOnLoad(gameObject);
thanks for replay can i save gameobject list without DontDestroyOnLoad?
I don't understand - you want to persist the data between closing and reopening the game?
Your answer
![](https://koobas.hobune.stream/wayback/20220612165552im_/https://answers.unity.com/themes/thub/images/avi.jpg)