I know this has been asked before, but, I can´t implement the other answers within my code (very noob here). Any help, greatly apreciated:
I have a turret and want to clamp the rotation, at 90° an 0°, so that it can only fire within that range.
var angle:float = 0.0f;
function Tilt (){
var spinAmount = Time.deltaTime*100;
if (Input.GetKey(KeyCode.Q))
{
angle = spinAmount;
transform.Rotate(angle,0,0);
}
thankx!