You could allign the blue part’s pivot to have the same position as its attachment; PivotTo moves the part based on its pivot. I don’t have much experience with this but you could play around with the numbers in the blue part’s pivot properties.
By line what do you mean exactly?
To have matching positions?
Can you draw it or position the parts so i can have better understanding of what you are trying to do?