hi, im developing a prototype and i want to make a gameobject rotate clockwise or anticlockwise when the player swipes up or down the screen. So far it is working but the movement is not smooth and i need the rotation to continue for as long as the player is touching the screen after the swipe. Please help me out on this. Heres the code
function Update ()
{
for (var touch : Touch in Input.touches)
{
if(touch.deltaPosition.y >= 1 && touch.position.x>250)
transform.Rotate(Vector3(0,0,50) * Time.deltaTime);
if(touch.deltaPosition.y <= -1 && touch.position.x>250)
transform.Rotate(Vector3(0,0,-50) * Time.deltaTime);
}
}