Instantiated child object incorrect transform

I’ve been at this days and days now and just cannot get my instantiated objects to appear in my scene in the correct place.

I have a main object at 107.5788, 0, 0

Then a child of this at 0, -0.02301085, 0

Then I try to attach a sphere to the child like this:

GameObject obj = (GameObject)Instantiate (MyObjectPrefab.transform, new Vector3 (-0.07983949f, -0.1397555f, 0.6569034f)], MyObjectPrefab.transform.rotation);

obj.transform.parent = hit.collider.gameObject.transform;

But no matter what I do the sphere seems to be getting place in world reference so appears way off to the left and tiny.

I just cannot get it to accept that the sphere should be attached to the child even when I set its parent?

Can anyone help please?

Thanks in advance

I’m assuming that this value ‘new Vector3 (-0.07983949f, -0.1397555f, 0.6569034f)’ is the local coordinate you want to place your object. If so, do it this way:

GameObject obj = (GameObject)Instantiate (MyObjectPrefab.transform, Vector3.zero, MyObjectPrefab.transform.rotation);
obj.transform.parent = hit.collider.gameObject.transform;
obj.transform.localPosition = new Vector3 (-0.07983949f, -0.1397555f, 0.6569034f);