Implement moveSpeed to this object script?

How can i implement moveSpeed into this script here? Right now when i click on the enemy, the player justs teleports on him and then falls and i don’t want that. I want him to move based on a speed you know move like normal :stuck_out_tongue:

using UnityEngine;
using System.Collections;

public class MoveObject : MonoBehaviour {
	
	public Transform target;
	
	void Start() {
		target = GameObject.FindWithTag("Enemy").transform;
	}	
	
	void Update() {
		if(Input.GetMouseButtonUp(0)) {
			transform.position = Vector3.Lerp(transform.position, target.position, Time.time);
		}
	}
}

You should increment the position over several frames.
One way to do it is to use Vector3.MoveTowards.

using UnityEngine;
using System.Collections;
 
public class MoveObject : MonoBehaviour {     
    public Transform target;
    public float moveSpeed; 
    bool isMoving;

    void Start() {
        target = GameObject.FindWithTag("Enemy").transform;
    }  
 
    void Update() {
       if (Input.GetMouseButtonUp(0))
           isMoving = true;

       if (isMoving && target)
           transform.position = Vector3.MoveTowards(
                                transform.position, 
                                target.position, 
                                moveSpeed * Time.deltaTime);
    }
}