Moving an object with vector3.MoveTowards
<p>I am working on a game app with Unity. I have an issue when it comes to move a GameObject .</p>

<p>In my game, when the player swipes up with his device, the GameObject moves from a point A to B, and when he swipes down, it goes from B to A.</p>

<p>I wrote a C# script with the game logic, but I have an issue when it comes to this.</p>

<p>The problem is that the GameObject moves instantly from A to B.</p>

<p>Here is the code line I use to move my GameObject :</p>

<pre><code>transform.localPosition = Vector3.MoveTowards (PositionA,PositionB,Time.deltaTime * speed);
</code></pre>

<p><code>speed</code> is a float with a value of 10.0f.</p>

<p>I would like my GameObject to move slowly to point A to B. And despite the changes on speed value, nothing change, it's still moving instantly.</p>

<p>How can I fix that? (I tried with <code>Vector3.Lerp</code> and I had the same results).</p>