How do I force the player in first-person and also free the mouse?

I am making a game with a main menu that will have GUI covering the screen. I want the player to be in first-person with a freed mouse so they cannot hold right-click down to freeze their mouse or use their scroll wheel to zoom in. I am not that good at scripting so I don’t know how to do this. Please help!

1 Like

Maybe try making their head into the camera? Like the camera cframe is the head cframe

You should have a GUI with ‘.Modal’ (or ‘ModalEnabled’, forgot the name) enabled, it allows the mouse to move while in first person

Do you mean UserInputService.ModalEnabled, this would disable character movement.

Just set the camera to the head CFrame.

No. GuiButton | Roblox Creator Documentation

This is what I’m talking about

1 Like

UserInputService | Roblox Creator Documentation to unlock the mouse

Player | Roblox Creator Documentation to lock first person

1 Like

unless the right mouse button is down.

I know that’s what it says, but from my experience of setting the camera CFrame to the head, you can’t move the camera freely either

1 Like

put this script into the StarterGui

local plrGui = game.Players.LocalPlayer:WaitForChild("PlayerGui")

local screenGui = Instance.new("ScreenGui", plrGui)

local Button = Instance.new("TextButton")
Button.BackgroundTransparency = 1
Button.Size = UDim2.new(0, 0, 0, 0)
Button.Modal = true
Button.Parent = screenGui
4 Likes

Thank you so much for this! You’re awesome.

1 Like

that’s a really hacky way of achieving what your trying to do, you should probably look into what @steven4547466 posted

1 Like