# Limit camera rotaion on x axis euler angles

I searched everywhere? but i didn't find the answer. How to limit camera rotation on x axis between - 90 and 90 with sych code. Help plis

```
transform.rotation *= Quaternion.AngleAxis(
-Input.GetAxis("Mouse Y") * _mouseSense,
Vector3.right
);
// Paw
transform.rotation = Quaternion.Euler(
transform.eulerAngles.x,
transform.eulerAngles.y + Input.GetAxis("Mouse X") * _mouseSense,
transform.eulerAngles.z
);
// Return to init position
if (Input.GetKeyDown(_initPositonButton))
{
transform.position = _initPosition;
transform.eulerAngles = _initRotation;
}
```

**Answer** by kirikar67
·
Dec 17, 2019 at 07:58 PM

i have found solution in such method

```
transform.rotation *= Quaternion.AngleAxis(
-Input.GetAxis("Mouse Y") * _mouseSense,
Vector3.right
);
// Paw
transform.rotation = Quaternion.Euler(
transform.eulerAngles.x,
transform.eulerAngles.y + Input.GetAxis("Mouse X") * _mouseSense,
0
);
if (transform.eulerAngles.x > 90 & transform.eulerAngles.x < 180)
{
Debug.Log("90");
transform.rotation = Quaternion.Euler(
90,
transform.eulerAngles.y,
0);
}
if (transform.eulerAngles.x < 270 & transform.eulerAngles.x > 180)
{
Debug.Log("270");
transform.rotation = Quaternion.Euler(
270,
transform.eulerAngles.y,
0);
}
```

But it has some issue: when player continue mooving mouse, camera starts jumping. How can fix that bug?

### Your answer

### Welcome to Unity Answers

The best place to ask and answer questions about development with Unity.

To help users navigate the site we have posted a site navigation guide.

If you are a new user to Unity Answers, check out our FAQ for more information.

Make sure to check out our Knowledge Base for commonly asked Unity questions.

If you are a moderator, see our Moderator Guidelines page.

We are making improvements to UA, see the list of changes.