Mouse locking in the wrong position

My issue is that the mouse locks in the screen (it appears to be following GUI inset) but when I click it, it decides nope, imma ignore GUI inset until I move my mouse… It doesn’t have anything to do with my Camera Script, as when i disable it, the thingy still happens

Im using Enum.MouseBehavior in UserInputService for what I am doing. Does Enum.MouseBehavior.LockCenter account for GUI inset?

Edit: It was GUI inset but idk how to fix it…

1 Like

Used with the UserInputService.MouseBehavior property of UserInputService to set how the user’s mouse behaves.

Enums

Name Value Description
Default 0 The mouse moves freely around the user’s screen.
LockCenter 1 The mouse is locked, and cannot move from, the center of the user’s screen.
LockCurrentPosition 2 The mouse is locked, and cannot move from, it’s current position on the user’s screen at the time of locking.

I don’t know to much about scripting but I found something related to this.
I may be wrong though.

Im using that, I went to that article to see if it explains something… Sure enough, it did not… My issue is that the cursor suddenly decides that it hates the GUI inset (only thing I can think would make this issue) when I click with the mouse…

@PostVivic
is this for first person?
then maybe the script is wrong?
also GUI usually only works for local script

No, its a custom camera script, But it is GUI inset, I confirmed that by doing the same thing in another game

@PostVivic

I can’t help much on this anymore because I am a noob at scripting so maybe get a actual programmer to fix it.

Im just going to completely ignore the mouse entirely, Setting the cursor to be disabled and using a gui

I think this might be a bug? It wasn’t doing this the other day and today my players have noticed that the position of the mouse is inconsistent with the crosshair in the game.


The crosshair is where the mouse lock cursor was before the latest roblox update, and the cursor moves a little bit every time you click? It also seems like screen size effects where the cursor moves when you click because I tested this in roblox studio and it moved higher up than in a game when you click.

1 Like