I'm not able to change the position of neither the UILabel prefab, nor its empty parent gameObject.
theParent stays at (0,0,0);
Here is my code:
GameObject theParent
= new GameObject
();theParent.layer = 11; // the GUI layer
theParent.transform.name = "MessageParent";
theParent
.transform.position = new Vector3
(0,
5,
0); // Is there anything wrong here?
GameObject comboInstance = NGUITools.AddChild(theParent,messagePrefab);
I'm trying to move the parent to avoid interfering with the animation of the child.
Note: messagePrefab has the following components: UILabel, an Animator and a "auto-destroy" script.
An animation changes its size and position; it starts right when the prefab is spawned.
Why can't my code change my UILabel position after instantiation?
Thanks in advance