I want to lock the camera to a part. How do I do so? I read up some articles and couldn't find the answer so I attempt to script it. It didn't gave me any errors but still failed to execute what I wanted. I did change the camera type to 'Scriptable' Here is my attempt:

v = 0.01
script.Parent.ClickDetector.Mouseclick:connect(function()
print(tostring(v))
game.Workspace.Camera.CameraSubject = script.Parent
cam.CFrame = script.Parent.CFrame
for i = 1,400 do
script.Parent.CFrame = script.Parent.CFrame - Vector3.new(0,0,tostring(v))
v = v + v
wait(0.0001)
end
end)

What I am trying to do is to make a part move and gain speed as it move and the camera following it. I do not really have much experience in scripting so this script may be very inefficient or bad.

2 comments

0

Please do not request for scripts.

0

^ I did not, I attempted the script unlike you. Without attempts, asking for help, that is requesting for script. Just because I warned you friendly, you don't have to raid my question.