Object Rotation on Drag/Swipe Problem...Take a look

What’s new people?
…Stuck again…

I have a plane with a steer-wheel texture, and is supposed to rotate by y axis when i drag left/right on x axis. But… every time i drag the touchPosition.x, the steer-wheel spins out of control and doesn’t follow my drag so precisely… the best solution would be to limit the rotation of +y and -y and also limit the drag of touchPosition.x (left and right) but i am unable to because of lack of experience…
second thing : the steer-wheel doesn’t stop spinning/rotating when i stop draging or swiping.
I’m trying to get the rotation as smoothly and precisely possible to simulate steering.
How to Fix this?

var RotateTime: float  = 0.1;
var SwipeTime: float = 0.4;
var rotateAngle : float = 0.0;
var minAngle;
var maxAngle;
var AnglePos : float = 10;
var AngleNeg : float = -10;
var currentAngle;
var object : Vector3;



function Update() {
	
//this is the rotate function...-- is there a alternative?
	
transform.Rotate(0, rotateAngle, 0);
		 
//the Touch Boundary
	
var Boundry : Rect = Rect(0, 0, 250, 250);

//swipe Function	

for (var j=0; j < Input.touchCount; ++j){
		var drags : Touch = Input.touches[j];
		
		if(drags.phase == TouchPhase.Began  Boundry.Contains(drags.position)){
			minAngle = drags.position.x;
			Debug.Log("touched" + minAngle);
		}
		else if(drags.phase == TouchPhase.Moved  Boundry.Contains(drags.position)){
			maxAngle = drags.position.x;
		}
		
        else if(drags.phase == TouchPhase.Ended){
			minAngle=maxAngle;
			rotateAngle = 0;
		}
		if(minAngle!=maxAngle){
			rotateAngle = (maxAngle - minAngle)/RotateTime;
		}
		else{
			rotateAngle = rotateAngle * SwipeTime;
		}
		if (rotateAngle >= AnglePos){
			rotateAngle = AnglePos;
			minAngle=maxAngle;
		}
		else if (rotateAngle <= AngleNeg){
			rotateAngle = AngleNeg;
			minAngle=maxAngle;
		}
	}
}

THX!

The transform.Rotate function rotates the object relative to its current orientation so using it will rotate on each frame. I think what you want to do here is to set the rotation to a specific angle depending on how far the mouse has been dragged. You can do this using Quaternion.AngleAxis. If you really do want the wheel to keep turning when you hold your finger still then you should scale the rotation angle by Time.deltaTime:-

transform.Rotate(0, rotateAngle * Time.deltaTime, 0);

Thanks man, i tried that but now it keeps speeding up the rotation as the rotation angle rises/lowers. I don’t know why, but when the rotateAngle is 10, y rotation goes to 270 deg and keeps rising. The main problem is that i can’t set minimum or maximum angle rotation.
It just doesn’t follow my finger… And when the phase is ended it doesn’t go back to 0 angle. Do you have any ideas?