Distance between two objects as a driver

Hi,
I’m trying to animate the strength of an object’s displacement using the distance of two objects as a driver.
How can I get the distance value of two objects?
Any advice and ideas will be much appreciated.

Here’s an option. It’s kind of brute forcey, but works…

distance = square root of DeltaX^2+DeltaY^2+DeltaZ^2

In python that’s…

sqrt(pow(mmx-omx,2)+pow(mmy-omy,2)+pow(mmz-omz,2))

MoveMe.blend (81.6 KB)

Can’t readily think of any other way to do it, SkpFX. Pythagoras saves the day, courtesy of a snake.