title: Making an object active after a few second with coroutine?
body: <p><a href="https://i.stack.imgur.com/23EIX.jpg" rel="nofollow noreferrer"><img src="https://i.stack.imgur.com/23EIX.jpg" alt="enter image description here"></a></p>
  
  <p>I'm making a game in which I want the object to start hidden or inactive and after a few seconds appear. I've tried with coroutine but the problem or error is, as I set my object from the start as hidden or inactive, that coroutine needs active objects, so I've tried it from another outside script but still no success. The second script doesn't even start. Does anyone have any suggestions or fixes?</p>
  
  <p>I've tried it from another outside script but still no success. In my added piscture the Num Trigger script just disables the object after collision.</p>
  
  <pre class="lang-c# prettyprint-override"><code>using System.Collections;
  using System.Collections.Generic;
  using UnityEngine;
  
  public class ActivationRutine : MonoBehaviour
  {
      public GameObject objectToActivate;
      // Start is called before the first frame update
      void Start()
      {
  
          StartCoroutine(StartFunction());
      }
  
      private IEnumerator StartFunction()
      {
          //Wait for 5 sec.
          yield return new WaitForSeconds(5);
  
          //Turn My game object that is set to false(off) to True(on).
          objectToActivate.SetActive(true);
      }
  }
  </code></pre>