title: In Unity, how can I save a list of gameobjects, including their state and make them persist into the next scene?
body: <p>I'm using Unity 5.2.0f3 for a current project that puts the player into a management role for a simulated factory. The player is given the option to hire additional workers during the game to speed up production. The player also has the option to choose a different floor layout (Unity scenes). The trouble I'm having is that all of the additional workers are destroyed each time a different layout is loaded, due to the scene change. </p>
  
  <p>I've tried adding DontDestroyOnLoad(gameObject) to the Start() function with no benefit. I've been scratching my head for a while now so I appreciate all your help with this.</p>
  
  <p>EDIT: Forgot to add relevant code..</p>
  
  <p>I have two scripts. HiringManager.cs to instantiate additional workers, and is attached to an empty gameobject, and WorkerAI.cs which is attached to each worker gameobject and handles worker behaviour.</p>
  
  <p>Code to instantiate additional workers (HiringManager):</p>
  
  <pre><code>public void HireWorker(string name) {
      _worker = Instantiate (worker) as GameObject;
      _worker.transform.parent = GameObject.Find ("Workers").transform;
      _worker.transform.position = new Vector2(-100f, -100f);
      _worker.name = name;
      _worker.tag = "New Worker";
  
      _workerAI = _worker.GetComponent&lt;NWorker.WorkerAI&gt;();
      _workerAI.isDragging = true;
  }
  </code></pre>
  
  <p>And code that I've tried (WorkerAI):</p>
  
  <pre><code>void Start()
      if (CompareTag("New Worker")) {
          DontDestroyOnLoad(gameObject);
      }
  }
  </code></pre>