How to make object move smoothly.

I have a script to make rocks float when I step onto a specific Collider.

The script i have works but it just changes the position in a flash. I want the rocks to flow smoothly :confused:

Here is the script.

using UnityEngine;
using System.Collections;

public class Rock_Levitate : MonoBehaviour {
	public GameObject floatingRock;
	public GameObject collider;
	public GameObject startPosition;
	public GameObject endPosition;
	public float moveSpeed = 10.0f;

	// Use this for initialization
	void Start () {
	floatingRock.transform.position = new Vector3 (startPosition.transform.position.x, startPosition.transform.position.y, startPosition.transform.position.z);
	}
	
	// Update is called once per frame
	void Update () {
	
	}


		void OnTriggerEnter (Collider col){
			if (col.gameObject.tag == "Player"){
			print ("Player has touched Rock Float Trigger");
			float step = moveSpeed * Time.deltaTime;
			floatingRock.transform.position = Vector3.Lerp (startPosition.transform.position, endPosition.transform.position, moveSpeed);
			print ("Rock is Moving.");
		}
	}
}

Maybe

     floatingRock.transform.position = Vector3.Lerp (startPosition.transform.position, endPosition.transform.position, step);

Instead of

 floatingRock.transform.position = Vector3.Lerp (startPosition.transform.position, endPosition.transform.position, moveSpeed);

You calculate โ€œstepโ€ correctly by multiplying your speed parameter by time.deltatime, but yet u use โ€œspeedโ€ in lerp.

Check the example here.

Perhaps, you need to use rigidbody.addforce. Its would help.