How to create building system like KSP?

I want to create a building system where you can put parts together at certain points on the mesh. How can I make it so that when two points get close enough they snap together ,but snap parts only appear on parts of the parts that can connect together? Do you have any tips or tutorial videos?

Maybe, you could use OnTriggerEnter functions to get them to snap at a certain poisition and when the mouse gets a certain distance away, it unsnaps. Just an idea.