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

Can this camera be fixed?

Asked by 9 years ago

Please make your question title relevant to your question content. It should be a one-sentence summary in question form.

Hello, I have here a script that fixes the current camera so the players only view the position of the brick. I was wondering how to make this stay fixed even if the player dies/resets? If a player dies, they are back to the normal set camera view. Also, is there a way to make it locked, so that a player cannot try to zoom out?

Here is the script:

local target = workspace.FixCam.Head
local camera = workspace.CurrentCamera
camera.CameraSubject = target
local angle = 5

while wait() do 
    camera.CoordinateFrame = CFrame.new(target.Position)
* CFrame.Angles(0,angle,0)
* CFrame.new(0,0,-50)


end

1 answer

Log in to vote
0
Answered by
sigve10 94
9 years ago

A normal script in workspace (Lets call it "A" for now):

game.Players.PlayerAdded:connect(function(player) -- Starts a function when the player is added
    player.CharacterAdded:connect(function(character) -- Continues the function when the player's character is added (respawned)
        script.B:clone().Parent = character -- Clones the localscript , "B", into the character at start
    end)
end)

And here is your script, place it in a localscript inside "A" (Let's call this one "B"):

local camera = workspace.CurrentCamera
local target = workspace.FixCam.Head
camera.CameraSubject = target
local angle = 5

while wait() do 
    camera.CoordinateFrame = CFrame.new(target.Position)
* CFrame.Angles(0,angle,0)
* CFrame.new(0,0,-50)


end

I hope this fixed your camera!

Ad

Answer this question