I have been tweening recently and I chose elastic but it is way too fast. How can I make it slower?
Time is the first parameter of the TweenInfo object that TweenService:Create takes as the second parameter.
local tweenInfo = TweenInfo.new(1, Enum.EasingStyle.Elastic, Enum.EasingDirection.Out) -- the 1 equals the amount of time it takes for the tween to go from start, to finish
So how would I put that into my script
Heres the full script (Some of it doesn’t affect tweening)
local Main = script.Parent
game.ReplicatedFirst:RemoveDefaultLoadingScreen()
wait(math.random(2,10))
local object = Main
object.Position = UDim2.new(0,0,0,0)
wait(2)
local FirstNumber = 0
local SecondNumber = 10
local final = "Loading Extra Assets: "..tostring(FirstNumber).."/"..tostring(SecondNumber)
while true do
wait(math.random(0.5,5))
FirstNumber = FirstNumber +1
local final = "Loading Extra Assets: "..tostring(FirstNumber).."/"..tostring(SecondNumber)
script.Parent.Main.Text = final
if FirstNumber >= SecondNumber then
break
end
end
object:TweenPosition(UDim2.new(-1,0,0,0), Enum.EasingDirection.In, Enum.EasingStyle.Elastic)
wait(4)
script.Parent.Parent:Destroy()
Time is the fourth parameter of TweenPosition, so you could do this:
object:TweenPosition(UDim2.new(-1,0,0,0), Enum.EasingDirection.In, Enum.EasingStyle.Elastic, TimeToComplete) --if you wanted the tween to move more quickly, you could set TimeToComplete to a small number such as 0.3
You need to replace TimeToComplete, with how long you want the duration of the tween to be, as a number in seconds.
Probably the right choice! If you need help with roblox tweening go here, > UI Animations | Documentation - Roblox Creator Hub
1 Like
Thanks! I will make sure to check that out.
Not a problem at all! Have a nice day, hope I was able to help!
1 Like