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

Can anyone tell me why this script is disabling character movement?

Asked by 6 years ago
Edited 6 years ago

It's a local script in StarterGui called CameraScript. When it's disabled the player can move fine. When it's enabled the player can only jump up and down.

local camera = workspace.CurrentCamera
camera.CameraType = Enum.CameraType.Scriptable

for i, v in pairs(game.Workspace:GetChildren()) do
    if v:FindFirstChild("Ship") and v:FindFirstChild("Owner").Value == game.Players.LocalPlayer.Name then
        camera.CameraSubject = v.Centre
        local target = v.Centre
        local x = target.Position.X
        local y = target.Position.Y
        local z = target.Position.Z
        camera.CoordinateFrame = CFrame.new(x,y+100,z) * CFrame.Angles(math.rad(-90),0,math.rad(180))
    end
end
0
So I changed the angle in line 11 from -90 to -89 and it works now. Apparently you can't have the camera looking straight down. Such a stupid thing. Lord_Pear 6 — 6y

Answer this question