Unity
- 1 ответ
- 0 вопросов
0
Вклад в тег
float currentRotationX = transform.eulerAngles.x;
float currentRotationY = transform.eulerAngles.y;
currentRotationX -= Input.GetAxis("Mouse Y") * rotationSpeed;
currentRotationY += Input.GetAxis("Mouse X") * rotationSpeed;
if (currentRotationX < 180 && currentRotationX > 0)
currentRotationX = Mathf.Clamp(currentRotationX, 0f, 50f);
if (currentRotationX < 0)
currentRotationX += 360;
if (currentRotationX > 180)
currentRotationX = Mathf.Clamp(currentRotationX, 310f, 360f);