Mouse locks to center of the screen upon right click

Hey guys, im making a first person game, and i would like the mouse to unlock upon the character’s demise. i have tried using UserInputService and setting the MouseBehavior to Default, but this still allows the player to lock their mouse again once they right click. i guess what i really want is for the camera and mouse to return to the format they were in before their character loaded in (i have characterAutoLoads disabled) Does anyone have any ideas?

1 Like

I disabled the lock to center by forking the PlayerModule from StarterPlayerScripts and commenting out line 1172 in BaseCamera. The line locks the mouse to the center if you’re in first person.

3 Likes

what is forking? I’ve seen people using that term, i have no clue what it is

Also, will this affect the first person aspect of my game?

Forking is when you press play in studio to copy the stuff that load by default, then paste it into studio so you can edit it yourself.

In this case, you’d copy the Module, PlayerModule, with CameraModule inside from StarterPlayerScripts. It’ll change first person by not making the mouse lock to center whenever the script tries to adjust the mouse for first person mode

2 Likes

wow, thank you! that worked well

1 Like

don’t know if anyone will find this useful one day but it’s on line 655 now. thanks

3 Likes