I created a ModuleScript to be called to tween a part to the middle of the screen, but it doesn't tween to the desired location. Intead of {0.402, 0},{0.467, 0}, it tweens to {0, 0}, {0, 0}. I'm not sure what I'm doing wrong here. Thank you in advance.
local module = {}
function module.load()
local TweenService = game:GetService("TweenService")
local tweenInfo = TweenInfo.new(
2.5, -- Time
Enum.EasingStyle.Sine, -- EasingStyle
Enum.EasingDirection.InOut, -- EasingDirection
0, -- RepeatCount (when less than zero the tween will loop indefinitely)
false, -- Reverses (tween will reverse once reaching it's goal)
0 -- DelayTime
)
TweenService:Create(script.Parent.TextLabel, tweenInfo, {Position=UDim2.new({0.402, 0},{0.467, 0})}):Play()
wait(5.5)
TweenService:Create(script.Parent.TextLabel, tweenInfo, {Position=UDim2.new({0.402, 0},{-1, 0})}):Play()
wait(2.5)
script.Parent:Destroy()
end
return module

1 comment
try removing the "{" and the "}" in the UDIM2 position in the tweens.