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
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);
}
}
}