title: Unity: Turn on one GameObject after the other with KeyPress
body: <p>I have 7 game objects or more. I want to run only one gameObject after the other. Starting with Gameobject 0 --&gt; GameObject 1 --&gt; GameObject 2. At the moment my script activates a new object each time <kbd>Space</kbd> is pressed, and the old ones are not deactivated.</p>
  <p>Thanks for your help!</p>
  <pre><code>using UnityEngine;
  using System.Collections;
  using System.Collections.Generic;
  
  public class ToggleTest : MonoBehaviour
  {
      public GameObject[] objects; 
      public int objCount = 0; 
  
  
      void Update()
      {
          if (Input.GetKeyDown(KeyCode.Space))
          {
  
              objCount += 1;
              objects[objCount].SetActive(true); 
              
          }
        
      }
  }
  </code></pre>