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

Why wont the Camera to to my desired CFrame Value?

Asked by 8 years ago

So I'm trying to make the Camera move to a Parts CFrame. Though instead of doing that it just moves 100+ studs away. My game is 99% terrain(Not sure if that helps). Any and all help is welcome.

game:GetService("UserInputService").InputBegan:connect(function(Input)
    local Player = game:GetService("Players").LocalPlayer
    if
        Input.KeyCode == Enum.KeyCode.Q then
        script.Parent.TextLabel:Destroy()

        Player.Character.Torso.CFrame = workspace.TorsoPos.CFrame

        --Camera
        workspace.CurrentCamera.CameraSubject = workspace
        workspace.CurrentCamera.Focus = workspace.One.CFrame
        workspace.CurrentCamera.HeadLocked = false
        workspace.CurrentCamera.CFrame = workspace.One.CFrame
        game:GetService("StarterPlayer").CameraMode = Enum.CameraMode.Classic

        workspace.CurrentCamera.CameraType = Enum.CameraType.Custom
    end
end)

1 answer

Log in to vote
1
Answered by 8 years ago

Set the player's Current Camera to Scriptable instead.

workspace.CurrentCamera.CameraType = Enum.CameraType.Scriptable
Ad

Answer this question