Inverse Kinematics

After you have set bones in the object.
Object Mode > Add > Armature

ik1's photo

Set it around the top of the object. > Name it "Target" > Blank the "Deform Check Box"

ik2's photo

Select the top bone of the object.

ik3's photo

Add Bone Constraint > Inverse Kinematics

ik4's photo

Target "Armature" > Bone "Target"

ik5's photo

Now, all parts of the object follows the Target bone.

ik6's photo

For moving in all directions, you have to set the POLE.
Add single bone > Name it "Pole" > Blank the "Deform check box"

ik7's photo

Select the top bone of the object. > Pole Target "Armature" > Bone "Pole"

ik8's photo

Then, you can move the object in any direction with all bones of the object

ik9's photo