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

How do I make the camera position change when a part is clicked with click detector?

Asked by 5 years ago

So, I am working on a button that changes your camera to the position of a brick. I put the local script in the click detector but it didn't work. No errors or anything, but here is my code.

local Player = game.Players.LocalPlayer local Character = Player.Character or Player.CharacterAdded local Camera = workspace.CurrentCamera

script.Parent.MouseClick:Connect(function() repeat wait() Camera.CameraType = Enum.CameraType.Scriptable until Camera.CameraType == Enum.CameraType.Scriptable Camera.CFrame = workspace.CameraPart.CFrame end)

So, that's my code. Don't know what I did wrong, but yeah, any tips? Code would be helpful though.

0
CurrentCamera has a CFrame like a part. SoftlockedUnderZero 668 — 5y

Answer this question