So I got it to work more or less, but what seems to be happening is at the end of the tween even though it’s repeating it’s basically snapping back to the origin CFrame. What I want to do is basically just constantly tween looking at a part. I’m creating an NPC that shoots, and I have another part that moves used for direction purposes.
How can I just get this to constantly keep tweening to the direction parts CFrame/Position/Direction?
function tweenCFrame(part, root)
local TweenService = game:GetService("TweenService")
local tweenInfo = TweenInfo.new(
1, -- Time
Enum.EasingStyle.Linear, -- EasingStyle
Enum.EasingDirection.Out, -- EasingDirection
-1, -- RepeatCount (when less than zero the tween will loop indefinitely)
false, -- Reverses (tween will reverse once reaching it's goal)
0 -- DelayTime
)
local tween = TweenService:Create(part,tweenInfo,{CFrame = CFrame.new(root.CFrame.p, cityFireFightScene:WaitForChild("Direction").CFrame.p)})
tween:Play()
end