I'm working on a simple plugin that lets you easily record establishing shots in studio. The basic premise is that you can set an interpolation end point and an interpolation length. However, even though I'm not getting any errors and I'm absolutely sure that my script is running all the way through, the camera itself never moves. Any help would be appreciated. Thanks!
NOTE: I've tried this in both a regular script and a local script, both yield the same result.
--user data local camera= Workspace:WaitForChild("Camera") --meta variables (All of these get a value from other parts in the script) local isOn =true local length= 1 local endPos =CFrame.new(0,0,0) local isRunning =false function interpolate() if isOn and length and endPos and not isRunning then isRunning=true if not camera then camera=Workspace:WaitForChild("Camera") end camera.CameraType=Enum.CameraType.Scriptable camera:Interpolate(endPos,endPos*CFrame.new(0,0,20),length) wait(length) if isRunning then camera.CameraType=Enum.CameraType.Fixed isRunning=false end end end runButton.MouseButton1Click:connect(interpolate)
I am not the best scripter and not fully sure about if this would work but, I will give this answer a shot. I have made some comments below.
--user data local camera= workspace:WaitForChild("Camera") --meta variables local isOn= true local length= 1 local endPos= local isRunning= false function interpolate() if isOn and not isRunning then -- I don't think you could check for the others, so I left these in. isRunning=true if not camera then camera=workspace:WaitForChild("Camera") -- Would be best to make the "W" on workspace a lower case. end camera.CameraType=Enum.CameraType.Scriptable camera:Interpolate(endPos,endPos*CFrame.new(0,0,20),length) wait(length) if isRunning then camera.CameraType=Enum.CameraType.Fixed isRunning=false end end end runButton.MouseButton1Click:connect(interpolate)
If this helped, please accept my answer :)