Hello everyone,
I am new to the community. I am trying to learn about the physics system. In doing so I have been making a space game. My main spaceship has smaller spaceships that currently orbit about the spaceship, but the way I am doing it is purely with linear algebra, not physics. And I am interested in solving this orbiting problem with physics. In doing so, I have discovered HingeJoint2D, but I cannot understand for the life of me how they really work. Would anyone be willing to explain AND help me with my physics orbiting problem, please? I would really appreciate it 
HingeJoint2D… you need to have two GameObjects. Each GameObject also needs to have a RigidBody2D and Collider2D. At least one of the GameObjects must be dynamic. The other GameObject can be Dynamic, Kinematic, or Static.
Now you add a HingeJoint2D to one of the GameObjects. Then configure that HingeJoint2D so that you set ConnectedRigidbody to be that of the other GameObject. Set the anchors of the two GameObjects… this is essentially the location from center of each GameObject that the HingeJoint2D should attach to.
At this point it’s like you’ve attached a door to the frame of the house via a hinge. Optionally you can activate the Motor on the HingeJoint2D which makes the “door” move by itself. Optionally you can set the AngleLimits on the HingeJoint2D so that the “door” can only move so far in either direction.