Not Enough Rotation

Hi, I’m trying to make the saucer shape below turn clockwise or anticlockwise by pressing the “z” or “c” key.

I can only make the saucer turn clockwise or anticlockwise about 1 or 2 degrees. How can I make the saucer turn more, even 360 degrees? My code is below:

using UnityEngine;
using System.Collections;

public class LimitRotate : MonoBehaviour {
public float rotationSpeed = 100.0f;
public float MaxTiltAngle = 20.0f;
public float tiltSpeed = 30.0f; // tilting speed in degrees/second
 
Vector3 curRot;
float maxX;
float maxZ;
float minX;
float minZ;

	
void Start () {
    // Get initial rotation
    curRot = this.transform.eulerAngles;
    // calculate limit angles:
    maxX = curRot.x + MaxTiltAngle;
    maxZ = curRot.z + MaxTiltAngle;
    minX = curRot.x - MaxTiltAngle;
    minZ = curRot.z - MaxTiltAngle;
	}
 
void Update () {
    // "rotate" the angles mathematically:
    curRot.x += Input.GetAxis("Vertical") * Time.deltaTime * tiltSpeed;
    curRot.z += Input.GetAxis("Horizontal") * Time.deltaTime * tiltSpeed;
    // Restrict rotation along x and z axes to the limit angles:
    curRot.x = Mathf.Clamp(curRot.x, minX, maxX);
    curRot.z = Mathf.Clamp(curRot.z, minZ, maxZ);
 
	float rotation = Input.GetAxis ("Rotate") * rotationSpeed;
	rotation *= Time.deltaTime;
		
    // Set the object rotation
    this.transform.eulerAngles = curRot;
	transform.Rotate (0, rotation, 0);
	}

}

On line 35, instead of rotation *= Time.deltaTime, do rotation *= Time.deltaTime*50

You are mixing an absolute rotation on line 38 with a relative rotation on line 39. So each time you execute line 38, you reset the ‘Y’ rotation back to 0. Here is a modification of your code that may be what you are looking for:

using UnityEngine;
using System.Collections;
 
public class LimitRotate : MonoBehaviour {
public float rotationSpeed = 100.0f;
public float MaxTiltAngle = 20.0f;
public float tiltSpeed = 30.0f; // tilting speed in degrees/second
 
Vector3 curRot;
float maxX;
float maxZ;
float minX;
float minZ;
 
 
void Start () {
    // Get initial rotation
    curRot = this.transform.eulerAngles;
    // calculate limit angles:
    maxX = curRot.x + MaxTiltAngle;
    maxZ = curRot.z + MaxTiltAngle;
    minX = curRot.x - MaxTiltAngle;
    minZ = curRot.z - MaxTiltAngle;
    }
 
void Update () {
    // "rotate" the angles mathematically:
    curRot.x += Input.GetAxis("Vertical") * Time.deltaTime * tiltSpeed;
    curRot.z += Input.GetAxis("Horizontal") * Time.deltaTime * tiltSpeed;
	curRot.y += Input.GetAxis ("Rotate") * Time.deltaTime * rotationSpeed;
    // Restrict rotation along x and z axes to the limit angles:
    curRot.x = Mathf.Clamp(curRot.x, minX, maxX);
    curRot.z = Mathf.Clamp(curRot.z, minZ, maxZ);
  
    transform.eulerAngles = curRot;
    }
}

Thanks robertu and create3dgames! Both your methods worked!