Does anyone have trouble with the editor freezing up during play? So like, if you create a new project and add this simple script to a camera so you can move it around…
private void Start()
{
Cursor.lockState = CursorLockMode.Locked;
Cursor.visible = false;
}
private void LateUpdate()
{
mouseX = Input.GetAxisRaw("Mouse X") * sensitivity;
mouseY = Input.GetAxisRaw("Mouse Y") * sensitivity;
xSmoother = Mathf.Lerp(xSmoother, mouseX, smoothness * Time.deltaTime);
ySmoother = Mathf.Lerp(ySmoother, mouseY, smoothness * Time.deltaTime);
yRotation += xSmoother;
xRotation -= ySmoother;
xRotation = Mathf.Clamp(xRotation, -90f, 60f);
transform.position = new Vector3(target.position.x, target.position.y + 5f, target.position.z);
target.rotation = Quaternion.Euler(0, yRotation, 0);
transform.rotation = Quaternion.Euler(xRotation, yRotation, 0);
}
Do you notice it freezing every now and then? It still is accepting input but the rendering will “hiccup” and the camera jumps to where your input would have been if it didn’t freeze.
This doesn’t happen if you build the game and play it that way.