Hi, i’m very new to all of this, and I’ve been working on it for hours now. I want to create a system similar to the gunbound/worms aim system. You use the up and down arrow keys to change your angle of fire. I’ve tried on both google and the unity3d search and I haven’t figured out a way to do it. I also tried using quaternions, but I can’t create limits for it, because I don’t want it wrapping continuously.

this is what I have currently, trying to create rotation with a limit

float maxAngle = 360;
float minAngle = 180;
void RotateShip(){
//Grab our rotation quaternion
Quaternion rot = transform.rotation;
//Grab the z euler angle
float z = rot.eulerAngles.z;
//Change the Z angle based on input
z += Input.GetAxis ("Vertical") * rotSpeed * Time.deltaTime;
//recreate the quaternion
rot = Quaternion.Euler(0, 0, z);
//feed the quaternion into our rotation
transform.rotation = rot;
if (z >= maxAngle && z <= minAngle){
if(z < maxAngle){
z =(maxAngle - .01f);
rot = Quaternion.Euler (19, 0, z);
transform.rotation = rot;
}
if(z < minAngle){
z = (minAngle + .01f);
rot = Quaternion.Euler (19, 0, z);
transform.rotation = rot;
}
}
}

sry pal - somehow I deleted my former answer so I’ll continue here from your last questions:

max swipe is the allowed swipe in degrees in both axis directions from the rest pose - let’s say you have a ship model placed with z=90 and maxswipe is 45, the model will rotate from 45 to 135, therefore 90 degrees of swipe in total. To reply quicker to your second question, I upgraded my former sample adding another axis of rotation - download it down here and check it out