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)

1 comment
Of course it can't run. Your if statement to run does not meet the standards.