how to set an object to parent unity code example
Example 1: transform object according to its parent unity
transform.localPosition = new Vector3(12.5f, 12.5f, 12.5f);
Example 2: how to get parent gameobject in unity
childObject.transform.parent.gameObject