JS Move object over time

When i press a button, an object moves in my game but it moves instantly, i was wondering how to make the transition smoother without using animation

    var MyGameObject : GameObject;

    if(Input.GetKeyDown("e"))
{
	MyGameObject.transform.position.x -= 1;
	MyGameObject.transform.position.y += 0.5;
}

Try

var MyGameObject : GameObject;
 
     if(Input.GetKeyDown("e"))
 {
     MyGameObject.transform.position.x -= 1 * Time.deltaTime;
     MyGameObject.transform.position.y += 0.5 * Time.deltaTime;
 }

:slight_smile: