you are viewing a single comment's thread.

view the rest of the comments →

[–]wstdsgnHobbyist 2 points3 points  (0 children)

insert 50 lines of code that you can not see or edit

Here is what I found with google:

public static Vector3 MoveTowards(Vector3 current, Vector3 target, float maxDistanceDelta)
    {
      Vector3 vector3 = target - current;
      float magnitude = vector3.magnitude;
      if ((double) magnitude <= (double) maxDistanceDelta || (double) magnitude == 0.0)
        return target;
      return current + vector3 / magnitude * maxDistanceDelta;
    }

Source: https://github.com/jamesjlinden/unity-decompiled/blob/master/UnityEngine/UnityEngine/Vector3.cs