Hi,
I am trying to add a child to another child of a hirarchy at runtime. But the parent-child are not following the transform correctly. As in, moving a parent 10 units in x-axis will not move the child the same distance with respect to parent.
The parent has a rigidbody but child are simple mesh objects.
My question is, am i doing it the right way to add child to another child.
code:
public var MountObject : GameObject;
function Awake()
{
MountObject = Instantiate(MountObject, transform.position, transform.rotation);
MountObject.transform.parent = transform;
MountObject.transform.localPosition = transform.localPosition;
}
Thankyou