Good day everyone,

I have a spaceship object which is able to be rotated by 360 of any Axis. Moreover, Camera smoothly follows ship rotation. Well, when I rotate spaceship by X axis, every 180 degree of X, Z and Y eulerAngles are changed from 0 to 180 suddenly, so Camera rapidly rotates as well by Y and Z axis, that is not meant to be .

How can I avoid it? Here is the code:

```
// Calculate the current rotation angles
wantedRotationAngleY = target.eulerAngles.y;
currentRotationAngleY = transform.eulerAngles.y;
wantedRotationAngleX = target.eulerAngles.x;
currentRotationAngleX = transform.eulerAngles.x;
wantedRotationAngleZ = target.eulerAngles.z;
currentRotationAngleZ = transform.eulerAngles.z;
// Damp the rotation around the y-axis
currentRotationAngleX = Mathf.LerpAngle(currentRotationAngleX, wantedRotationAngleX, rotationDamping * Time.deltaTime*10);
currentRotationAngleY = Mathf.LerpAngle(currentRotationAngleY, wantedRotationAngleY, rotationDamping * Time.deltaTime*10);
currentRotationAngleZ = Mathf.LerpAngle(currentRotationAngleZ, wantedRotationAngleZ, rotationDamping * Time.deltaTime*10);
//Camera rotation and position
// Convert the angle into a rotation
Quaternion currentRotation = Quaternion.Euler (currentRotationAngleX, currentRotationAngleY, currentRotationAngleZ);
//Quaternion currentRotation = Quaternion.Lerp(transform.rotation, target.rotation, Time.deltaTime * 2.0f);
transform.position = target.position;
transform.position -= currentRotation * Vector3.forward;
transform.rotation = currentRotation;
```

Thanks in advance