Hi, I have written this simple line of code, that should rotate an empty and drag the camera behind with a 20° offset.
void Update () {
// Moving Parent and Camholder
parentMesh.transform.Rotate (0,Input.GetAxis ("Mouse X") * Time.deltaTime * mouseSensivety, 0);
//Moving Cam
cam.transform.eulerAngles = new Vector3(Mathf.Clamp(cam.transform.eulerAngles.x, parentMesh.transform.eulerAngles.x - 20f, parentMesh.transform.eulerAngles.x + 20f), Mathf.Clamp(parentMesh.transform.eulerAngles.y, parentMesh.transform.eulerAngles.y - 20f, parentMesh.transform.eulerAngles.y + 20f), 0);
}
But it simply rotates the Camera instantly, as if I directly applied the .Rotate to it.
What can I do to have it working right?