Hey again!
There are several ways. I usually use MoveTowards. This doesn't have slowing down near the end and you can pretty much compare the positions.
if (theObject.transform.position == end)
If you want to use lerp, you can use Mathf.Approx to compare the x and y.
[Unity Doc][1]
[1]: http://docs.unity3d.com/Documentation/ScriptReference/Mathf.Approximately.html
↧