Rotating an object with Quaternion.LookRotation

The following code works fine to rotate the object. I can’t figure out why the object is not facing the camera if the forward vector is perfectly alligned with the camera as you can see bellow (red raycast). Any ideas?

        Vector3 dir = transform.position - selection.position;

        Debug.DrawRay(selection.position, dir, Color.red);
        Debug.DrawRay(selection.position, selection.forward, Color.green);
        Debug.DrawRay(selection.position, selection.right, Color.yellow);

        Quaternion rot = Quaternion.LookRotation(dir, Vector3.up);
        rot.x = 0; rot.z = 0;
        selection.rotation = rot;

52475-unity.png

Uh I figured the problem myself. I was setting the selection (wich is a GameObject) rotation before populating it with the children GameObjects.

The children where being created with a rotation on the parent wich caused the problems. Modifying the rotation after did the trick. Hope it helps someone!