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.