try to get wanted position by mouse look smooth

i find this script :

private var xtargetRotation:float=10;
private var ytargetRotation:float=10;
var xSensitivity:float=10;
var ySensitivity:float=10;
var smoothing=2;
var min=-60;
var max=60;
 
function Update () 
{
 
var yAxisMove:float=Input.GetAxis("Mouse Y")*ySensitivity; // how much has the mouse moved?
ytargetRotation+=-yAxisMove; // what is the target angle of rotation
ytargetRotation=ytargetRotation % 360;
ytargetRotation=Mathf.Clamp(ytargetRotation,min,max);
 
var xAxisMove:float=Input.GetAxis("Mouse X")*xSensitivity; // how much has the mouse moved?
xtargetRotation+=xAxisMove; // what is the target angle of rotation
xtargetRotation=xtargetRotation % 360;
 
 
transform.localRotation=Quaternion.Lerp(transform.localRotation,Quaternion.Euler(ytargetRotation,0,0),Time.deltaTime*10/smoothing);
transform.parent.rotation=Quaternion.Lerp(transform.parent.rotation,Quaternion.Euler(0,xtargetRotation,0),Time.deltaTime*10/smoothing);
}

but whenever (not english lol) i start the game , the play start at rotation y 9.999999 , but i wanna start when i want to …

any modifications or tip ???


Your player will start with that rotation because your variable ytargetRotation is equal to 10. Set xtargetRotation and ytargetRotation equal to the number you want them to start at.