Quantcast
Channel: Latest Questions on Unity Answers
Viewing all articles
Browse latest Browse all 171066

Rotation always changing values!

$
0
0
Vector3 rot = transform.localEulerAngles; if(Input.GetKey(KeyCode.P)) { rot.y = 160.0f; mouseLook.enabled = false; theCamera.localRotation = Quaternion.Slerp(theCamera.localRotation, Quaternion.Euler(rot), Time.deltaTime * 10); } else { mouseLook.enabled = true; theCamera.localRotation = Quaternion.Slerp(theCamera.localRotation, Quaternion.identity, Time.deltaTime * 10); } How do I fix the camera rotation so that it will not change all the time if localRotation.y will reach to zero after I released the "P" button

Viewing all articles
Browse latest Browse all 171066

Trending Articles



<script src="https://jsc.adskeeper.com/r/s/rssing.com.1596347.js" async> </script>