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

How to properly fade? And Tween? [Unanswered]

Asked by
Shawnyg 4330 Trusted Badge of Merit Snack Break Moderation Voter Community Moderator
10 years ago

I've tried the fading several different ways, but it just pops away. Like I destroy it before the fade.

Also, the tweening, it's not smooth. It just pops like I changed the Visible property

a = game.Lighting.Welcome_GUI

game.Players.PlayerAdded:connect(function(p)
    p:WaitForChild("PlayerGui")
    a:clone().Parent = p.PlayerGui
    wait(2)
    p.PlayerGui.Welcome_GUI.ImageLabel:TweenPosition(UDim2.new(0,0,0,0),"Out","Quad",.99)
    repeat
        p.PlayerGui.Welcome_GUI.ImageLabel.ImageTransparency = p.PlayerGui.Welcome_GUI.ImageLabel.ImageTransparency + 0.1
        wait(0.01)
    until
    p.PlayerGui.Welcome_GUI.ImageLabel.ImageTransparency == 1
    p.PlayerGui.Welcome_GUI:Destroy()
end)

0
Try changing + 0.1 to less, like 0.05. About tweening, it is very smooth I think. Tesouro 407 — 10y
0
It still didn't fix it. Any other tips? Shawnyg 4330 — 10y
0
The issue may be because this is being done from the server. Try doing the same code from the client (without the PlayerAdded event of course). Also, check line 12, you use a '==' to set the value. A typo? Should be '='. Tkdriverx 514 — 9y

1 answer

Log in to vote
1
Answered by 10 years ago

The way I fade is, with a loop.

a = game.Lighting.Welcome_GUI

game.Players.PlayerAdded:connect(function(p)
    p:WaitForChild("PlayerGui")
    a:Clone().Parent = p.PlayerGui
    wait(2)
    p.Playergui.WelcomeGUI.ImageLabel:TweenPosition(UDim2.n.ew(0,0,0,0),"Out","Quad", 0.99)
    for i=1, 10 do
        p.PlayerGui.Welcome_GUI.ImageLabel.ImageTransparency = p.PlayerGui.Welcome_GUI.ImageLabel.ImageTransparency + 0.1
    end
    p.PlayerGui.Welcome_GUI:Destroy()
end)

This may have some minor typos, I reccomend retyping this just to make sure :P

Ad

Answer this question