I tell unity to spin around the Z axis but in the engine it stil rotate around the y Axis. rotating around the Y and X axis isn’t a problem.
Note: Localrotation and rotation doesn’t make a diffrent.
here is the part code that does the spinning.
yRotation += Input.GetAxis(“Mouse X”) * lookSensitivity;
currentYRotation = Mathf.SmoothDamp(currentYRotation, yRotation, yRotationV, lookSmoothDamp);
var Rotate: Vector3;
if(place== "y"){
Rotate= Vector3(0,currentYRotation,0);
}
if(place== "-y"){
Rotate= Vector3(0,-currentYRotation,180);
}
if(place== "x"){
Rotate= Vector3(currentYRotation,0,270);
}
if(place== "-x"){
Rotate= Vector3(-currentYRotation,0,90);
}
if(place== "z"){
Rotate= Vector3(90,0,currentYRotation);
}
if(place== "-z"){
Rotate= Vector3(270,0,-currentYRotation);
}
transform.rotation= Quaternion.Euler(Rotate);
PS: srry for bad English if there’s any