title: Transform.SetParent won't work?
body: <p>i am trying to give an object as a child of another after beeing instanciated but nothing seem to do it, (you will find my essays as commented codes)</p>
  
  <pre><code> void Update()
   {  
          if (!isCreated)
          {
                  if ( GameObject.Find("blue").GetComponent&lt;Rigidbody2D&gt;().velocity.magnitude == 0 
                  &amp;&amp;(Time.time &gt;1))
              {
                  Instantiate (indice, new Vector3 (gameObject.transform.localPosition.x + 0.5f ,
                                                    gameObject.transform.localPosition.y + 2,
                                                    gameObject.transform.localPosition.z ),
                                   Quaternion.identity);
                  Debug.Log (this.GetComponent&lt;Item&gt;().name.ToString());
                  //indice.SetActive(false);
                  //indice.transform.SetParent(this.GetComponent&lt;Item&gt;().transform, true);
                  indice.transform.SetParent(GameObject.Find(this.name.ToString()).transform, false);
                  //indice.transform.parent = gameObject.transform;
                  //indice.name = this.transform.name.ToString()+"ItemIndice";
  //              GameObject.Find(indice.name).SetActive(false);
                  isCreated=true;
                  gameObject.GetComponent&lt;Rigidbody2D&gt;().isKinematic = true;
                  gameObject.GetComponent&lt;Collider2D&gt;().isTrigger = true;
              } 
  
          }
      }
  </code></pre>