On a first person controller, how do limit the movement of my cursor to the middle two thirds of my screen. This is so that the cursor can be more useful in selecting game objects quickly. The first person will continue to rotate but the mouse will not pass the 2/3 screen position.
I don’t want to lock the cursor completely or hide it. I just want to restrain it to the middle 2/3 of my screen.
Sorry I have no sample script to start with. I couldn’t find a starting point for this one.
Turn off the real cursor. Create a GUITexture of crosshairs or something that looks like a cursor. Use mouse motion to place and move that on the screen, but kept it in range. Ex (not real code, do not use):
float cursorX=0.5f; // middle of screen. Using 0-1
float xMv = (Input.mousePosition.x - oldMouse.x)/Screen.width;
// NOTE: translating 10 pixel mouse move into 0.03% screen move
cursorX += xMv;
if(cursorX<0.33f) cursorX=0.33f; // middle 2/3s
....
crosshairs.position = new Vector3(cursorX, cursorY, 0);