In my Android game I’m using this code to move a camera from one position to another.
private var Speed: float = 0.05;
if(Input.GetTouch(0).deltaPosition.x < 0 || Input.GetTouch(0).deltaPosition.x > 0)
{
this.transform.position.x -= Input.GetTouch(0).deltaPosition.x * Speed;
}
What I would like to have is ease in and ease out of the movement.
I’ve tried it with Mathf.SmoothStep, Mathf.Lerp, etc. but I don’t get it work.
Can anybody help me to make it work?