GameObject destroyed when changing scene
I made a game when a round finished, the player will be directed to the main menu. If the player try to open the game scene again, the score (text UI) component is destroyed with this kind of error "The object of type 'Text' has been destroyed but you are still trying to access it" eventhough I has not been destroying it. Why should I do to keep the score text to keep displaying?
Answer by lvskiprof · Jan 26 at 08:04 PM
You need to make the score a singleton object. An old ticket that talked bout this is here: https://answers.unity.com/questions/891380/unity-c-singleton.html
Basically, your class won't get destroyed when you change scenes. You need to find it at the start of the new scene, so you have a reference to the object again for use in the new scene.