好的,这是我的代码:
float temp1 = Mathf.Sin(Input.mousePosition.x - Screen.width / 2);
float temp2 = Mathf.Cos(Input.mousePosition.y - Screen.height / 2);
Camera.mainCamera.transform.parent.transform.Rotate(temp1,temp2,0);
所以我试图根据鼠标和相机父母之间的角度旋转相机的父级。除了我做错了什么可以有人帮助我吗?
提前致谢!
答案 0 :(得分:0)
float temp1 = Mathf.Cos( (Input.mousePosition.x - Screen.width) / 2 );
float temp2 = Mathf.Sin( -(Input.mousePosition.y - Screen.height) / 2);
Camera.mainCamera.transform.parent.transform.Rotate(temp1, temp2, 0);