local tweenService = game:GetService("TweenService")
local turret = script.Parent
while wait(0.5) do
local target = nil
local Info = TweenInfo.new(
2, -- number Time
Enum.EasingStyle.Sine, --Easing Style
Enum.EasingDirection.Out, --Easing Direction
0,
false,
0
)
for i, v in pairs(game.Workspace:GetChildren()) do
local human = v:FindFirstChild("Humanoid")
local torso = v:FindFirstChild("Torso")
if torso and human then
target = torso
end
end
if target then
local torso = target
local goal =
{
Position = CFrame.new(turret.Position, torso.Position)
}
local tweenmovement = tweenService:Create(turret, Info, goal)
wait(1)
tweenmovement:Play()
end
end
I need help in making the part follow the torso with a smooth animation but I am not sure how to apply tweenService in this kind of script.
