set parent

How do i change the parent of a gameObject through javascript?

Parent-ness is actually a relationship between Transforms, not Gameobjects. So if a and b are gameobjects and you want to make b the child of a, you’d do b.transform.parent = a.transform.