- Home /
Question by
lukdye · Jul 29, 2019 at 10:04 PM ·
lagdelaywindows 10
Delay while rotating a camera (doesn't happen in the editor)
Problem: In the editor's test mode, when I move my mouse, the camera rotates near instantly, but when I build the project as a standalone application, it takes about a quarter of a second to rotate the camera. Is it because of windows, or is it a known issue with unity 2019.1.2? Here's my code:
private GameObject playerobj;
private float xRotate, yRotate;
void Start() {
playerobj = GameObject.Find("Player1");
}
void Update() {
xRotate = Mathf.Min(90, Mathf.Max(-90, xRotate + -Input.GetAxis("Mouse Y") * 3));
yRotate = yRotate + Input.GetAxis("Mouse X") * 3;
playerobj.transform.localRotation = Quaternion.Euler(0, yRotate, 0);
transform.localRotation = Quaternion.Euler(xRotate, 0, 0);
}
Comment
Answer by Kennai · Jul 30, 2019 at 10:55 AM
Hello, @lukdye !
Its because you dont adjust your rotation speed by Time.deltaTime.
In Editor FPS is less than in standalone application, so it rotates more slowly in Editor.
You multiply Input.GetAxis by 3, instead of that try to multiply by 50*Time.deltaTime or rotSpeed*Time.deltaTime and adjust value of rotSpeed.
Your answer
![](https://koobas.hobune.stream/wayback/20220612205718im_/https://answers.unity.com/themes/thub/images/avi.jpg)