Hi,
Ok, I took a close look now and was able to recreate the scene. There is one thing, I am still struggling with. The instantiation of the prefab happens here in AddChild.
static public GameObject AddChild (GameObject parent, GameObject prefab)
{
GameObject go = GameObject.Instantiate(prefab) as GameObject;
if (go != null && parent != null)
{
Transform t = go.transform;
t.parent = parent.transform;
t.localPosition = Vector3.zero;
t.localRotation = Quaternion.identity;
t.localScale = Vector3.one;
go.layer = parent.layer;
}
return go;
}
I am instantiating my prefabs on a plane, which actually works, but they are "inside" the plane. I'd like them a little bit above the plane. So I tried....
t
.localPosition = new Vector3
(0,
1,
0);
But it didn't change anything. Am I thinking in a completely wrong way?
Thank you!