I have a cube in the scene. Now I want to move this object from one vector3 point to another vector3 point with smooth start and smooth end movement.
I tried this:
transform.position = Vector3.Lerp(transform.position, randomPoint, speed * Time.deltaTime);
With this I have a smooth end movement, but not a smooth start movement.
I also tried Vector3.SmoothDamp(). Here is the same problem. There is only a smooth end movement.
There are various solutions for this same issue on this Forum thread:
A smooth (ease in out) version of Lerp?
Also check out this Reddit thread for more details on this matter: Vector3.Lerp, slow in and out, and even translation.
I think what you want specifically is Mathf.SmoothStep applied to the 3 parts of a Vector3.
transform.position = Vector3(
Mathf.SmoothStep(transform.position.x, randomPoint.x, speed * Time.deltaTime),
Mathf.SmoothStep(transform.position.y, randomPoint.y, speed * Time.deltaTime),
Mathf.SmoothStep(transform.position.z, randomPoint.z, speed * Time.deltaTime));