Moving an object with just a key tap.

Hello all,

I’m developing a little card game where the cards show directions a player can move. You draw your cards, drag and drop the ordering of them and then press a key to play through the directions. Up, Up, Left, Right, for example. The issue I’m having is moving the object smoothly in the right direction instead of it “jumping” to its position.

use Mathf.Lerp

Either use Mathf.Lerp() as Rafael notes, or Mathf.MoveTowards(), or move it gradually yourself… OR…

Step up above all that silly microcoding and use a tweening package such as LeanTween or DOTween, both of which are free on the asset store and can do just about everything you need for any game.