I'm trying to give an object as a child of instanciated but after beeing anything else To think, (you will find my essay in the form of comment code)
zero update () {ifCreated} {if (GameObject.Find ("blue"!) GetComponent . & Lt; Rigidbody2D & gt; () velocity.magnitude == 0 & amp; (Time.time & gt; 1)) {Illustrations (indice, new Vector3 (gameObject.transform.localPosition.x + 0.5 F, gameObject.transform.localPosition.y + 2, gameObject.transform.localPosition.z), Quaternians. Resident); Debug. Log (GetComponent & lt; Items & gt; (.). Name.ToString ()); //indice.SetActive (false); //indice.transform.SetParent(this.GetComponent<Item>().transform, true); Indice.transform.SetParent (GameObject.Find (this.name.ToString ()) Transform, false); //indice.transform.parent = GameObject.transform; //indice.name = this.transform.name.ToString () + "Item Indiatia"; // Game Object.Fid (Indie's name) .Setactive (false); IsCreated = true; GameObject.GetComponent & lt; Rigidbody2D & gt; (). IsKinematic = true; GameObject.GetComponent & lt; Collider2D & gt; (). IsTrigger = true; Text after "div" = "itemprop =" text "> You illustrate the new object but this is not allocated. You can check with Instantiate
.
Instantiate (indice, new vector 3 (gameObject.transform.localPosition.x + 0.5f, gameObject.transform.localPosition.y + 2, GameObject.transform.localPosition.z), Quaternion. Identity); You can use it Game Object New Indus = Institute , GameObject.transform .localPosition.y + 2, gameObject.transform.localPosition.z), Quaternion.identity) as GameObject;
After that you can set the parent object to New Indies. Like
newIndice.transform.parent = gameObject.transform;
No comments:
Post a Comment