Greetings,
I created a FPS shooter game for a school assignment. I have one issue I can’t really seem to fix. I have this issue for both Mac and Windows. Basically I can’t seem to find a way to clamp the mouse to the window. It keeps leaving the window especially when your shooting the gun. This really kind of sucks now that we’ve added health to the mobs and we are no longer just destroying the prefabs. I’ve tried the following while it will hide the mouse until it leaves the screen. It doesn’t seem to help much with keeping the mouse in the window.
Cursor.visible = false;
Cursor.lockState = CursorLockMode.Confined;