 # Space.Self smooth rotating menu around hand. How can I control the speed of the rotation?

``````using UnityEngine;

public class Lerp : MonoBehaviour
{
[Range(0, 360)]
public float angle = 120;//Specify Angle For Rotation
float tempAngle;//Temporary Angle Measurement Variable
bool horizontalFlag;//Check For Horizontal Roation
bool isRotating;//Check Whether Currently Object is Rotating Or Not.
int Direction;//Direction Of Rotation

//Called For Initialization
void Start()
{
horizontalFlag = isRotating = false;
}
//Method For Horizontal Input
void CheckForHorizontalInput()
{
if (Input.GetAxis("Horizontal") != 0 && !isRotating)
{
isRotating = true;
Direction = (Input.GetAxis("Horizontal") < 0 ? - 1 : 1);
horizontalFlag = true;
tempAngle = 0;
}
}
//Method For horizontal Rotation
void HorizontalRotation()
{

transform.Rotate(Vector3.back * angle * Time.fixedDeltaTime * Direction, Space.Self);
tempAngle += angle * Time.fixedDeltaTime;
if (tempAngle >= angle)
{
tempAngle = 0;
isRotating = false;
horizontalFlag = false;
}
}
void Update()
{
CheckForHorizontalInput();
if (horizontalFlag)
HorizontalRotation();
}
}
``````

I want to be able to control the speed of the rotation of the object in seconds. now the menu is 3 pages and it is rotating with 120 degrees smoothly and stops on 120 degrees. Also if the button pressed is hold the rotation continues and stops on the same range of 120 degrees that the menu is in. if I move the joystick left the menu rotates left if I move the joystick to the right the menu rotates to the right. Can you tell me how to do this?