- Home /
Question by
imM4TT · Dec 13, 2017 at 04:50 PM ·
canvasinstantiate prefab
Display a canvas at one point
HI im trying to instantiate the gameobject UI which is inside a canvas when i tell him to do that. But that just doesnt work. There is my code. If my prefabUI spawn, will he keeps up his position on the screen that i defined before in the canvas??
public GameObject prefabUI;
void Start () {
Instantiate(prefabUI) as GameObject;
enemy.transform.SetParent (GameObject.FindGameObjectWithTag("Canvas").transform, false);
}
}
Comment
Your answer
