I am trying to make it so when this cannon script runs, 1 of the things that happens is your camera moves its location with tweening. Interpolate wouldn't work at all, and it is discouraged. Any idea how I can fix this script?
local Workspace = game:GetService("Workspace")
local UserInputService = game:GetService("UserInputService")
local PlayerName = script.Parent.Parent.Parent.Name
local Character = Workspace[PlayerName]
local Cannon = Workspace.Cannon
UserInputService.InputBegan:Connect(function(input)
if input.KeyCode == Enum.KeyCode.E then
for i, v in pairs(Character:GetDescendants()) do
v.Anchored = true
end
-- Code below here is setting up the camera
local cam = workspace.CurrentCamera
local TweenService = game:GetService("TweenService")
local tweenInfo = TweenInfo.new(
2,
Enum.EasingStyle.Quint,
Enum.EasingDirection.Out,
0,
false
)
local tweenProperties = {
CFrame = CFrame.new(Cannon.EndPart.Position, Cannon.EndPart.Orientation)
}
local Tween = TweenService:Create(cam, tweenInfo, tweenProperties)
cam.CameraType = "Scriptable"
Tween:Play()
end
end)
There are no issues with the code running in the first place, it just won't work.

4 comments
@cookie_more Notice the order of parameters in the tool-tip as you type and at https://developer.roblox.com/en-us/api-reference/function/TweenService/Create
It didn't change anything. Your definitely right, but it still isn't working.
Made an edit.
Just making a comment to remind you that your question is still unanswered. Does it work or not?