How to limit the rotation of transform.Rotate Z in 2D
float speed = 30.0f;
private void Update() {
float h = Input.GetAxis("Horizontal");
h = h * speed * Time.deltaTime;
transform.Rotate(Vector3.forward * h);
}
i want limit rotation Z of transform in 2D plz help...
Comment
I do not speak English well. It is not my first language. I rely on Google Translator.
my question means how to iimit angle Limiting the rotation angle of a rotating object about the z axis.
Nice to have someone comment. problem solve now.