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

Camera Manipulation not working?

Asked by 4 years ago

help, the code below doesn't work. the click detector is in the clickpart and the code below is in a local script


script.Parent.Parent.ClickPart.ClickDetector.MouseClick:Connect(function() local camera = game.Workspace.CurrentCamera camera.CameraType = Enum.CameraType.Scriptable camera.CFrame = script.Parent.cam.CFrame end)

2 answers

Log in to vote
0
Answered by 4 years ago

The entire LocalScript won't run because it's not a descendant of the player (given that you're referencing a part with script.Parent.Parent.ClickPart). Move the LocalScript to StarterGui, StarterPack, etc, and access the part via game.Workspace.ClickPart (assuming it's a direct child of workspace).

Ad
Log in to vote
-1
Answered by 4 years ago

I suppose that you should use CFrame.new to make this work.

Answer this question