- Home /
Other - question is impossible to read
can someone explain me this script
this time i'm vs the fps mouse look modified :) :
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); }
the thing idk is what does the ytargetroration do and why there is a % ... but i'd like if someone can explain me the ENTIRE script :D thanks