My game forces first person, so the mouse is locked in the middle of the screen. However, I would like to add a shop gui. The gui is pretty much useless when the mouse is stuck in the middle of the screen and can't click the buttons. I want to try to avoid making a keybind for every button in the gui. Is there any way I can simply let the mouse move freely while keeping the player in first person? Thanks in advanced
[Edit - I like your solution better, but didn't fully read your comment until after I posted this. I'll leave this here as an alternative.] You can have a GuiButton in your GUI with the Modal property enabled. If you don't use GuiButtons, you can add an invisible one (that is, it can have a Size of UDim2.new(0,0,0,0) to be invisible; it has to have Visible
set to true
).
You could have a button to activate/deactivate the mouse, which could simply toggle this button's Modal property.
In the force first person script make it were if a GUI is enabled then disable the force script then If the GUI is not enabled then make force first person enabled.
If you like for me to give a script for an example, please edit your question and add the force first person script. Thank you!