The Hinge Joint 2D component allows a game object controlled by rigidbody physics to be attached to a point in space around which it can rotate. The rotation can be left to happen passively (in response to a collision, say) or be actively powered by a motor torque provided by the joint itself. You can set limits to prevent the hinge from making a full rotation, or make more than a single rotation.