Question by
petrv-filipp · Oct 11, 2015 at 05:08 AM ·
javascriptquaternionrotatelimitglobal
How can I limit rotate "missile gun" in global coordinates ? Java
var rotateSpeed = 120.0;
function Update() {
var rotateAmount = rotateSpeed * Time.deltaTime;
if (Input.GetKey("up")) {
transform.Rotate(-rotateAmount, 0, 0);
}
if (Input.GetKey("down")) {
transform.Rotate(rotateAmount, 0, 0);
}
}
Comment
Your answer
![](https://koobas.hobune.stream/wayback/20220612040848im_/https://answers.unity.com/themes/thub/images/avi.jpg)