Mouse cursor no longer locked in center in first person

Weird bug that I started encountering about a week ago:

So, I figured this out while I was playing Phantom Forces. If I move my mouse down to see what’s below me, it actually moves the system mouse cursor (while in-game, it remains in the same spot and acts as it normally does). If I look down, suddenly my system cursor is in my taskbar, opening other programs and minimizing ROBLOX. If I look too high up, suddenly I’m resizing the ROBLOX window. It’s really obnoxious and it just started happening the other week. Any ideas what’s going on? I’m not even positive that this is a ROBLOX bug and not just something wrong with my mouse.

gif:

You can see the ROBLOX window has focus, however the cursor is still moving in first person.

edit: upon further testing, it appears to only occur in Phantom Forces - it acts as expected with mouse lock and first person in other games. w e i r d. Something with forced first person maybe? Can anyone link to other games that have forced first person?

4 Likes

I tried out Polyguns and it happened there. I’m not sure if it opened stuff on the same monitor, but I do know that I had two connected and when I moved the cursor too far to the left the mouse moved on the other monitor. I had to disconnect the second monitor to play properly.

3 Likes

This seems really inconsistent, too. I’m noticing now it’s not doing it as often, or I’m finding that after playing for a little while it’s fixed (will investigate)

Yea it’s been happening to one of my games. Repro might be setying cursor to LockCenter every frame. I’d test it but I’m in school right now.

2 Likes

I’m starting to think I can reproduce it, but not positive. It seems like it can be reproduced by alt-tabbing, and can be fixed by hitting Escape (and Escape again to get out of the menu)

@zKevin could you help confirm this?

Just tested it and that looks to be the problem. Alt tab out then click back in the window and the mouse is free to go anywhere.

2 Likes

I’v experienced this for a very long time, I stopped using the mouse to cast ray in ADS mode because of this.

1 Like

I’ll investigate into this and let you guys know what I find, thanks!

3 Likes

The default ROBLOX camera script (found in StarterPlayer–>StarterPlayerScripts) was recently updated so that if you use the left and/or right mouse button (I don’t remember which one(s)), it makes the camera free to move.

Even if you have the CameraType set to Scriptable, or the MouseBehaviour set to LockToCentre, it still does that. I fixed it by deleting the default CameraScript , and using my own version.
If you can find one of the previous versions of the CameraScript and then delete the current one and replace it with an old version, I guess that’ll work fine.

I made a thread about this a while ago too:
http://devforum.roblox.com/t/mouse-hit-not-working/28405/2

You can just put a LocalScript in StarterPlayerScripts with the same name and ROBLOX will automatically use that instead of the default.

Also, scripts in StarterPlayerScripts only run once when the player joins (not every time they respawn), so you’d only need to replace the CameraScript once with what you’re doing.

Well, that will be helpful when I use them more in the future. Thanks.