- Home /
Question by
Satamanster · Jul 12, 2012 at 03:01 AM ·
mouselimits
Set boundaries to mouse rotation behaviour.
Hello guys, how do i set this script to have a minimum and a maximum value of change? Any ideas here? Thank you all.
Script:
//cannon rotation
var verticalSpeed : float = 2.0;
function Update () {
//Mouse delta (this value is not between -1 and 1)
var v : float = verticalSpeed * Input.GetAxis ("Mouse X");
//Debug.Log(Input.GetAxis("Mouse X"));
transform.Rotate (0, 0, v);
}
Comment
Your answer
![](https://koobas.hobune.stream/wayback/20220613074053im_/https://answers.unity.com/themes/thub/images/avi.jpg)