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.

01game:GetService("UserInputService").InputBegan:connect(function(Input)
02    local Player = game:GetService("Players").LocalPlayer
03    if
04        Input.KeyCode == Enum.KeyCode.Q then
05        script.Parent.TextLabel:Destroy()
06 
07        Player.Character.Torso.CFrame = workspace.TorsoPos.CFrame
08 
09        --Camera
10        workspace.CurrentCamera.CameraSubject = workspace
11        workspace.CurrentCamera.Focus = workspace.One.CFrame
12        workspace.CurrentCamera.HeadLocked = false
13        workspace.CurrentCamera.CFrame = workspace.One.CFrame
14        game:GetService("StarterPlayer").CameraMode = Enum.CameraMode.Classic
15 
16        workspace.CurrentCamera.CameraType = Enum.CameraType.Custom
17    end
18end)

1 answer

Log in to vote
1
Answered by 8 years ago

Set the player's Current Camera to Scriptable instead.

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

Answer this question