# How to use Vector3.Lerp without slow-down

I have a script that allows me to aim and it does a smooth transition between to Vector3’s but sometimes the transitions slows down a lot. How do I make it so that it doesn’t move so slow sometimes?

Here’s my aiming code :

``````var Smoothing : float;

var HipPose : Vector3;

var AimPose : Vector3;

function Update () {

var newPosition : Vector3 = transform.position;

if(Input.GetButton("Fire2")){

transform.localPosition = AimPose;
Cam.fieldOfView = 40;
GunCam.fieldOfView = 20;

}

if(!Input.GetButton("Fire2")){

transform.localPosition = HipPose;
Cam.fieldOfView = 60;
GunCam.fieldOfView = 60;

}

transform.position = Vector3.Lerp(transform.position, newPosition, Smoothing * Time.deltaTime);

}
``````

If you don’t want your movement to be eased you can change from using Vector3.Lerp() to using Vector3.MoveTowards(). The value of ‘Smoothing’ will also have to change. Or as an alternate, you can change the last parameter of the Lerp() to using a timer and set the values so that they increase from 0.0 to 1.0. Your use of Lerp() here is a non-traditional use (though common in Unity code posted to this list). It really just takes a fractional bite out of the distance each frame. As the distance falls, the fraction is a smaller distance and therefore produces an eased movement.

Another aproach could be :

``````towerTop.rotation = Quaternion.Lerp(towerTop.rotation,Quaternion.LookRotation(leadDirection, transform.up),Time.deltaTime * damping);
``````

And if you want to make it slowdown you just use:

``````towerTop.rotation = Quaternion.**SLerp**(towerTop.rotation,Quaternion.LookRotation(leadDirection, transform.up),Time.deltaTime * damping);
``````

why using a vectorin that case

var newPosition : Vector3 = transform.position;

id just do NewPosition = Transform.position;