While working on my project with Pointer Lock Controls, I came across a bug. When the player is pressing any directional keys on the keyboard and simultaneously presses the escape button to turn off the Pointer Lock Controls, the camera continues to move in the background even though it is not visible. Subsequently, when the player clicks the mouse button to turn the Pointer Lock Controls back on, the camera is in a different position. How can this issue be resolved? Is there a way to prevent camera movement when the controls are turned off? You can observe this behavior in the Pointer Lock Control example -