how to stop rotation from being uncontrollable

So I wrote some code to make an object rotate if I swiped left or right
using System.Collections;
using System.Collections.Generic;
using UnityEngine;

public class Rotater : MonoBehaviour {

public Transform player;

void Update()
if (Input.touchCount == 1)
Touch touch0 = Input.GetTouch(0);

    if (touch0.phase == TouchPhase.Moved)
        player.transform.Rotate(0f, 0f, touch0.deltaPosition.x);



and the problem is when I swipe fast the rotation will be uncontrollable. So I want the input to be less sensitive.

my goal is for the rotation to be like rolly vortex

my setup:
(watch for context: - YouTube)

  • I made an empty object and put it in the center

  • made the empty object a parent of my player

  • and finally, I put my code in the empty object

this setup made the player rotate in sort of an orbit which like I told you is similar to rolly vortex.

I never used touch input so I’m assuming you just want to decrease that value of your input between frames. if I am correct I suppose you would just divide your input value until it is suitable.

player.transform.Rotate(0f, 0f, touch0.deltaPosition.x / 5.0f);

I’m not sure if that is what you meant, but if it is, just change the 5.0f around if need be until it is the correct coefficient.