set limit mouse x y Help needed

is there a way to limit mouses x y defined by me

sorry i am a super noob

a script i can put on any object to limit mouse movement

i am not looking for script to rotate or mouselook or eny thing like that

just a script that limit Mouse X from -45 to 45, and Mouse Y form -5 to 30


hop there is a way

There’s no way I know of to limit the mouse cursor to a specific range. But as a workaround, you can hide the mouse cursor (See Screen.showCursor()), and implement your own image that is moved by the mouse. You can then limit the movement of your own image to any range you want. You will likely want to use relative movement based on the change in cursor position of the mouse rather than absolute if you go this route.