Hi people.
I am trying to smooth camera axis with different smooth values.
public Transform target;
public float Smooth = 5f;
Vector3 Offset;
void Start ()
{
Offset = transform.position - target.position;
}
void Update ()
{
Vector3 TargetCampos = target.position + Offset;
TargetCampos.y = transform.position.y;
transform.position = Vector3.Lerp(transform.position, TargetCampos, Smooth * Time.deltaTime);
Vector3 TargetCampos2 = target.position;
TargetCampos2.y = target.position.y;
transform.position = Vector3.Lerp(transform.position, TargetCampos2, 5f * Time.deltaTime);
}
I want Y have a different smooth value than X.
But I can’t make it work. I am not sure what i am doing wrong.