Hello, What I'm trying to create is when a player clicks on a part, which would activate the MouseClick event on the ClickDetector, and when clicked, it changes the camera position to the part, and rotates around it, for some reason when I tried it out, nothing happens... Here is the script that I was talking about...
Note: The Child inside the Part is the Local Script and the ClickDetector.
local target = script.Parent
local camera = game.Workspace.CurrentCamera
local angle = 0
local isPlaying = false
script.Parent.ClickDetector.MouseClick:connect(function()
camera.CameraType = Enum.CameraType.Scriptable
camera.CameraSubject = target
isPlaying = true
end)
while isPlaying do
camera.CFrame = CFrame.new(target.Position)
* CFrame.Angles(0, angle, 0)
* CFrame.new(0, 3, 5)
angle = angle + math.rad(1)
wait()
end
Thank you!
~NanotechSci

1 comment
Hello! I have tried putting the while loop inside the event, but nothing happens :(