Mathf.Abs(myTransform.position-target.position)

Mathf.Abs(myTransform.position-target.position)

Error:
The best overloaded method match for `UnityEngine.Mathf.Abs(float)’ has some invalid arguments

.position is a vector3 mathf.Abs needs float.

(myTransform.position-target.position).magnitude to get distance between 2 positions