This is a 2D game and everything has y=0. I want to move a GameObject from position A to position B using Transform.Translate and has some limits on the translation. But I have problem on how to compute the translation vector.
public void MoveToUsingTranslation(Vector3 targetPos)
{
Vector3 translation = Vector3.zero;
// translation = ???
translation.x = Mathf.Clamp(translation.x, -1500, 1500);
translation.y = 0; // 2d movement
translation.z = Mathf.Clamp(translation.y, -1500, 1500);
transform.Translate(translation);
}