How to set distance between 2 objects?
You can just use a Limit Distance constraint for that. Simply add the constraint in the Constraints properties and set the target to your other object. Set Distance to the distance you require and Clamp Region to 'On Surface'. This will constrain your object to remain on the surface of a sphere projected around the target object.