Scripting Helpers is winding down operations and is now read-only. More info→
Ad
Log in to vote
0

Error with trying to tween the position of 3 ImageLabels. Help?

Asked by 4 years ago

If I could put a video, I would.

I'm trying to make a loading screen where three dots will simultaneously move up and down, like they are bouncing. The first dot moves up, then the second, then the third. Then, it goes in that same exact order, except they will all move back down.

The problem here, is that the first dot will move up, then the second, then the third. Then the moment when they will go in that same order moving back down, the second and third dots will stay in the up position instead of moving back down. They will not move back down forever and I cannot find out how to solve this issue.

Here is the script that makes the loading animation play until the game is loaded:

game.ReplicatedFirst:RemoveDefaultLoadingScreen()

local PlayerGui = game.Players.LocalPlayer:WaitForChild("PlayerGui")

local GUI = script.loadingGui:Clone()
GUI.Parent = PlayerGui

local function loadingAnimation()

    GUI.loadingFrame.loadingPeriod1:TweenPosition(UDim2.new(GUI.loadingFrame.loadingPeriod1.Position.X.Scale,0,.205,0),"Out","Sine",0.5)
    wait(.2)
    GUI.loadingFrame.loadingPeriod2:TweenPosition(UDim2.new(GUI.loadingFrame.loadingPeriod2.Position.X.Scale,0,.205,0),"Out","Sine",0.5)
    wait(.2)
    GUI.loadingFrame.loadingPeriod3:TweenPosition(UDim2.new(GUI.loadingFrame.loadingPeriod3.Position.X.Scale,0,.205,0),"Out","Sine",0.5)
    wait(.1)
    GUI.loadingFrame.loadingPeriod1:TweenPosition(UDim2.new(GUI.loadingFrame.loadingPeriod1.Position.X.Scale,0,0.567,0),"In","Sine",0.5)
    wait(.1)
    GUI.loadingFrame.loadingPeriod2:TweenPosition(UDim2.new(GUI.loadingFrame.loadingPeriod2.Position.X.Scale,0,0.567,0),"In","Sine",0.5)
    wait(.1)
    GUI.loadingFrame.loadingPeriod3:TweenPosition(UDim2.new(GUI.loadingFrame.loadingPeriod3.Position.X.Scale,0,0.567,0),"In","Sine",0.5)
    wait(2)

end

repeat loadingAnimation() until game:IsLoaded()

GUI.backgroundFrame1:TweenPosition(UDim2.new(-1,0,0,0),"Out","Sine",1)
GUI.backgroundFrame2:TweenPosition(UDim2.new(2,0,0,0),"Out","Sine",1)
wait(.5)
GUI:Destroy()

0
Try making a coroutine for the 3 dots and use ContentProvider for it to actually wait for the game to load. https://developer.roblox.com/en-us/api-reference/function/ContentProvider/PreloadAsync uhi_o 417 — 4y
0
^^ raid6n 2196 — 4y
0
Im confused on the ContentProvider part. After watching tutorials on it, I'm not sure how I would use it/implement it into the script without messing anything up. Could you provide an explanation or example about it? awesomesauce905 4 — 4y

Answer this question