Make cursor not locked on center in (Forced) First person

Hello. I am developing a game that’s first person only. Due to various mechanics, I need the cursor NOT to be locked in the center of the screen, which it seems like I can’t achieve.
This is what I tried and why it didn’t work:

  • I tried using a script that sets the UserInputService.MouseBehavior to default. Apparently that works, however the player can’t move the camera around (RMB/MB2 + Mouse), which is kind of necessary.
  • I tried using a Frame in a ScreenGui with Active = True, that however made the player not able to move the camera either.
  • I tried using a ImageButton in a ScreenGui with Modal = True, but players weren’t able to click things that are in game, same goes if I turned Active to false.

I have searched multiple times, YouTube, DevForum, internet, etc., but haven’t found anything that helped me.
I am a scripter, therefore it won’t be hard for me to create scripts if you tell me what I need to do.

Thanks in advance for anything

1 Like
UIS.MouseBehaviour = Enum.MouseBehavious.Default

This would do the trick.

1 Like

As I said, that, as it must be in a loop, doesn’t do the trick as it’s meant to, since players can’t use the right mouse button to move the camera around. Using it without a loop doesn’t work.

What?

well you got to set model = false . If you want it to be fp while allowing player to click on ui, that is impossible unless you add press z to go Interact with ui mode

This is tough. You might just have to set the max and min zoom distance to of the camera to something like 5 and make the character transparent to the player. As far as I know every time you’re in first person your mouse is forced to lock. You could probably find another solution though if you looked hard enough.

2 Likes

Was this ever solved?
Similar situation

you can try this

UIS.MouseBehaviour = Enum.MouseBehavious.Default

Doesn’t work as intended.
However I did find a work around -
In the Default PlayerModule > CameraModule > BaseCamera.
Line 766 -

function BaseCamera:EnterFirstPerson()
	self.inFirstPerson = true
	self:UpdateMouseBehavior()
end

Remove this and no more first person lock :slight_smile:

2 Likes

A solution was found by myself. I browsed all camera modules and scripts. There is one specific line that locks the cursor. I do not remember where it is nor what was the exact code. If someone is interested, let me know. I will look it up again.

2 Likes

This topic was automatically closed 14 days after the last reply. New replies are no longer allowed.