How do I make the interpolate work and not doing nothing? none of the variables are nil btw
local Camera = Game:GetService("Workspace").CurrentCamera local Focus1 = CP:WaitForChild("Focus1").Position local Pos2 = CP:WaitForChild("Pos2").Position local HRP = Character:WaitForChild("HumanoidRootPart") coroutine.resume(coroutine.create(function() print("a") Camera.CameraType = 6 -- Scriptable print("b") Camera:Interpolate(HRP.CFrame, Foc1, 2) print("c") wait(2) Camera:Interpolate(Pos2, Foc1, 15) print("e") end))
the script stops at b and then doesnt do anything
You haven't defined Foc1
; the variable you made was named Focus1
, so indeed, Foc1
is actually nil
.
However, Focus1
and Pos2
still are problems since the Interpolate
method requires CFrame values, not Vector3 values.
You can make a new CFrame with the default orientation as a position p
using CFrame.new(p)
.