object escape player unity

C#
Vector3 dir = transform.position - Target.position;
transform.Translate(dir * moveSpeed * Time.deltaTime);
Source

Also in C#: