Scripting Helpers is winding down operations and is now read-only. More info→
Ad
Log in to vote
0

Setting to a Normal FPS View?

Asked by
woodengop 1134 Moderation Voter
8 years ago

I've been working on a 2D game, and I made a Brick that When stepped on, it will change the view from 2D to FPS. The only problem is that The mouse is in the middle of the screen but no Camera Coordinates are changing

Localscript

game:GetService("RunService").RenderStepped:connect(function() -- camera script PLS do not copy
    if hd then
        cam.FieldOfView="50"
        cam.CoordinateFrame=CFrame.new(hd.Position+Vector3.new(xValue.Value,yValue.Value,zValue.Value),hd.Position)*CFrame.Angles(0,0,-.1)
    end
end)

Script

game.Players.PlayerAdded:connect(function(plr)
        for i,v in ipairs(workspace:GetChildren()) do
        if v:IsA("BasePart") and v.Name=="InToFPS" then
            v.Touched:connect(function()
                plr.CameraMaxZoomDistance=0.5
                for _,scripts in ipairs(startergui) do
                    if scripts.Name=="Camera" then
                        repeat wait(); until scripts;
                        scripts.Disabled=true
                    end
                end
            end)
        end
    end
end)

--[[ `Index`
`startergui` a variable that gains access to it's children
`workspace` the `Workspace` of `Game`
--]]

0
Couldn't you use plr.CameraMode = "LockedFirstPerson" ? funyun 958 — 8y
0
Both ways work. woodengop 1134 — 8y

Answer this question