Quantcast
Channel: Questions in topic: "maintain"
Viewing all articles
Browse latest Browse all 19

maintain script on different scenes

$
0
0

How can I maintain script which is attached to the game object over different scene.

GameObject testobj;

void Start()
{
      testobj = new GameObject("Test");
testobj.Addcomponent<TestScript>();
}

how can I maintain TestScript which contains the connection to the server and don't want to lose during the next scene loading.

DontDestroyOnLoad(testobj) doesnt work.


Viewing all articles
Browse latest Browse all 19

Trending Articles





<script src="https://jsc.adskeeper.com/r/s/rssing.com.1596347.js" async> </script>