# How to make your ski slip like a little drift?

Hi, I have been facing a problem for a few days. I want to make a ski move look realistic.

In short, the game object follows the touch position on the screen, but when the player suddenly switch the touch position, I want the object to slide like a drift (Third Image), after going to that touch position. In my case, it goes directly to the touch position (Second Image)

### How can I obtain such effect?

My Code so Far:

``````void Update ()
{
//Check if the screen is touched
if (Input.touchCount > 0 )
{
Touch touch = Input.GetTouch(0);
isTouching = true;

if (touch.phase == TouchPhase.Stationary || touch.phase == TouchPhase.Moved)
{
//Calculate the direction of the touch
Vector3 touchPos = Camera.main.ScreenToWorldPoint(new Vector3(touch.position.x, touch.position.y, 10));
Vector3 direction = touchPos - ski.transform.position;

//Calculate the angle ski should be rotated
float angleSki = -Mathf.Atan2(direction.y, direction.x) * Mathf.Rad2Deg - 90;

//Rotate the ski
ski.transform.eulerAngles = Vector3.forward * -angleSki;

Vector3 vectorDirection = new Vector3(direction.x, -transform.up.y, 0);
if (vectorDirection.magnitude > 1.0f)
vectorDirection.Normalize();

transform.Translate(moveSpeed * Time.deltaTime * vectorDirection);
}
}   else
isTouching = false;

//Mooving forward if the screen is not touched
if (!isTouching)
{
ski.transform.rotation = Quaternion.Euler(0, 0, 0);
transform.Translate(moveSpeed * Time.deltaTime * new Vector3(0, -transform.up.y, 0));
}
}
``````

Drifting naturally results from physics interactions, as such you should be able to get a decent approximation by adding more elements from real physics.

What it appears you need in this case is momentum. Instead of changing to position to be closer to the touch position, you should change the velocity to be close to the touch direction.

Essentially, a decent effect could be given by keeping track of a velocity vector and changing it such that it approaches the direction vector you calculated.

From context, however, I can assume the skier is going down a hill. As such you would only need to have momentum in the x direction, and perhaps use a normalized version of the velocity so the y changes as well.

You can use Splines package to animate your object along a spline here

https://docs.unity3d.com/Packages/com.unity.splines@2.5/manual/animate-spline.html

To do that you need 4 control points: start, point + 2 additional points to make it curve exactly how you need here.