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

The Camera isn't working?

Asked by 10 years ago
local target = Workspace.Grass
local camera = Workspace.CurrentCamera
camera.CameraType = Enum.CameraType.Scriptable
camera.CameraSubject = target
local angle = 100
local i = 0


while wait() do
    camera.CoordinateFrame = CFrame.new(target.Position)
                            * CFrame.Angles(0, angle, 0)
                            * CFrame.new(0, 100, 200)
    angle = angle + math.rad(1)
    script.Parent.StartGui.ClassFrame.Buttons.PlayKnightButton.MouseButton1Down:connect(function(onClick)
    print("Works")
        camera.CameraType = Enum.CameraType.Custom
        game.Workspace.CurrentCamera.CameraSubject = game.Players.LocalPlayer.Character.Humanoid
    end)
end

I am trying to get it so when a player joins the camera rotates around the baseplate. That works, but I want when the PlayKnightButton is presseed it changes the camera to the normal positon. It checks the mouse and does print "Works" and it changes the cameratype to custom and the subject to humanoid, but the camera is on a wierd angle. Any ideas?

0
What do you mean by weird angle? Spongocardo 1991 — 10y
0
well when the button is cliked, it goes to the player but the angle isnt right, instead of being behind the player its in front with a few degrees to the left NinjoOnline 1146 — 10y

Answer this question