Short distance detecting device
I'd stick with electromagnets aka inductive loops for doing what you want. Whilst not in the presense of big chunks of metal you can get pretty consistent fields generated inversely proportional to distance cubed. Use an oscilator to excite a central loop and use smaller loops tuned to the resonant frequency for measuring the field strength.

Careful though this only works in the one plane  - if you rotate a loop thru 90 degrees it will likely go thru a position where no field is detected. So then you use diversity if you need 3D distance detection - two transmit loops at right angles operating at different frequencies.