So I’m just trying to tween a part slightly 5 studs away from it’s current position and then back. But for some reason it flys way away, what am I doing wrong?
task.wait(8)
function tweenPart(part)
local TweenService = game:GetService("TweenService")
part.Position = Vector3.new(part.Position)
part.Anchored = true
local tweenInfo = TweenInfo.new(
8, -- Time
Enum.EasingStyle.Linear, -- EasingStyle
Enum.EasingDirection.Out, -- EasingDirection
-1, -- RepeatCount (when less than zero the tween will loop indefinitely)
true, -- Reverses (tween will reverse once reaching it's goal)
0 -- DelayTime
)
local tween = TweenService:Create(part, tweenInfo, {Position = part.Position - Vector3.new(5,0,0)})
tween:Play()
print("tweening")
end
tweenPart(script.Parent)