I have an object that has this rotate script.
function LateUpdate () {
if (isCameraInputIgnored() ) {
return;
}
if (target && Input.GetMouseButton(0)) {
x += Input.GetAxis("Mouse X") * xSpeed *0.02; //x rotation
y -= Input.GetAxis("Mouse Y") * ySpeed *0.02; //y rotation
y = ClampAngle(y, yMinLimit, yMaxLimit);
var rotation = Quaternion.Euler(y, x, 0);
//var position = rotation * Vector3(0.0, 11.0, -distance+0.49548)+ target.position;
var position = rotation * Vector3(0.900528, 8.829305, -distance+0.49548)+ target.position;
transform.rotation = rotation;
transform.position = position;
}
}
isCameraInputIgnored() returnes true if the mouse is over some gui textures. My problem is that when i hit play and press the mouse button (just a simple click) my camera changes possition a little bit and my object appear as moving. How can i set the camera to remain at the first position or how can i set camera to start already moved ?