- Home /
Question by
rhbrr5hrfgdfgw · Jun 08, 2014 at 06:58 PM ·
rotationtransformweapon
Trying to rotate weapon
i am trying to rotate the weapon until it gets to a certain rotation(Stop the rotation).
this is the code
function Update () {
if(Input.GetKey(KeyCode.A)){
transform.Rotate(Vector3.right * Time.deltaTime * 10);
}
if(transform.eulerAngles.x >= 5.1){
transform.eulerAngles.x = 5.1;
}
}
I am walking left and its simply rotates. when the x gets to 5.1 i want it to stop even though i am still walking left.
Comment
Never $$anonymous$$d you were right, changed to transform.localEulerAngles.x