First person view with GUIs

Basicly in my game I have the first person script the problem is the menu got GUIs and I cant click on “Play” or something because I got the first person script.

Is here any way for use first person view while the GUIs are on?

--variables--
local camera = workspace.CurrentCamera
local player = game.Players.LocalPlayer
local character = player.Character
local humanoid = character.Humanoid
 
player.CameraMaxZoomDistance = 0.5
camera.FieldOfView = 100
humanoid.CameraOffset = Vector3.new(0, 0, -1)
 
for childIndex, child in pairs(character:GetChildren()) do
    if child:IsA("BasePart") and child.Name ~= "Head" then
       
        child:GetPropertyChangedSignal("LocalTransparencyModifier"):Connect(function()
            child.LocalTransparencyModifier = child.Transparency
        end)
       
        child.LocalTransparencyModifier = child.Transparency
       
    end
end
 
camera:GetPropertyChangedSignal("CameraSubject"):Connect(function()
    if camera.CameraSubject:IsA("VehicleSeat") then
        camera.CameraSubject = humanoid
    end
end)

I tried to change the camera max zoom in the local script inside the GUI (play button)

3 Likes

I think the Modal property of a GuiButton is what you are looking for. If a GuiButton with Modal enabled is visible it unlocks the mouse so the player can interact with GUI and stuff.

4 Likes

so like before I click play the gui is modal is enabled and when I click play I make it off?

You shouldn’t have to set the modal to false, just making the play button invisible or disabling the parent screen gui is fine.

I can use it on the frame? (is full screen)

It is a property of GuiButton, so children instances like TextButton and ImageButton have the property. If any button has modal enabled and is visible, the mouse is unlocked and can move freely.