title: Instantiated 2D text doesn't show up in Unity
body: <p>Excuse me for any grammatical errors. (I know that there are many questions like this here, but I haven't found a solution yet).</p>
  
  <p>I'm trying to instantiate a 2d object with a 2d text, the problem here is that the text is invisible when instantiated. Yes, I know that I have to set a canvas as parent of it but it is still not working...
  Code: </p>
  
  <pre><code>Instantiate(levelAsteroid, new Vector3(-7, 2.25f, 0), Quaternion.identity, 
  GameObject.FindGameObjectWithTag ("Canvas").transform);
  </code></pre>
  
  <p>Unity hierarchy, when the object is instantiated:</p>
  
  <p><a href="https://i.stack.imgur.com/bOWqX.png" rel="nofollow noreferrer"><img src="https://i.stack.imgur.com/bOWqX.png" alt="Hierarchy"></a></p>
  
  <p>Canvas settings:</p>
  
  <p><a href="https://i.stack.imgur.com/yYrHv.png" rel="nofollow noreferrer"><img src="https://i.stack.imgur.com/yYrHv.png" alt="canvas"></a></p>
  
  <p>Update:
  I think I found the problem.
  If I just instantiate the object, it works fine, the text is visible, but if I try to change the text from the script, the text becomes corrupt, after that the text won't never show up not even if I put the object in the canvas manually.</p>
  
  <p><strong>FIXED:</strong>
  The problem seems to be the way I used to change the text..
  Before, I used to instantiate the object and change the text from a script attached to the GameController, now I change the text from a script attached to the object that has the text as child.</p>
  
  <p>Before:
  (Script attached to the GameController):</p>
  
  <pre><code>public GameObject exampleOfObj;
  void instantiateObj(){
          object = Instantiate(exampleOfObj, new Vector3(-800, 300f, 0), Quaternion.identity);
          object.transform.SetParent (GameObject.FindGameObjectWithTag ("Canvas").transform, false);
          objectText.SetText ("Text: " + value);
  }
  </code></pre>
  
  <p>I simply removed the call to the "SetText" method and I have put this into the script that is attached to the object that I'm instantiating.
  I found a solution but I don't understand why it was a problem.</p>