Here is my code i need to stop the camera from rotating when its 90 degrees
public float borderthickness = 10f;
public float cameramovespeed = 10000f;
// Update is called once per frame
void Update()
{
Quaternion pos = transform.rotation;
if (Input.mousePosition.y >= Screen.height - borderthickness && pos.x < 90f)
{
pos.x -= cameramovespeed * Time.deltaTime;
Debug.Log("up");
}
if (Input.mousePosition.y <= borderthickness && pos.x < 90f)
{
pos.x += cameramovespeed * Time.deltaTime;
Debug.Log("down");
}
if (Input.mousePosition.x >= Screen.width - borderthickness && pos.y < 90f)
{
pos.y += cameramovespeed * Time.deltaTime;
Debug.Log("right");
}
if (Input.mousePosition.x <= borderthickness && pos.y < 90)
{
pos.y -= cameramovespeed * Time.deltaTime;
Debug.Log("left");
}
transform.rotation = pos;