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

Why does my tween have this weird effect to the "alert" TextLabel?

Asked by 6 years ago

When the text gets tweened it has a weird stuttery or twitching effect to it (if you look very closely)

Is there any possible way to fix this?

Hierarchy and GIF Image

Script:

01while true do
02    if game.Workspace.severethunderstormwatch.Value == true then
03        local pos = script.Parent.alert.Position
04        script.Parent.TextLabel.Text = " "
05        script.Parent.randomtext.Disabled = true
06        script.Parent.alert.Text = "SEVERE THUNDERSTORM WATCH IN EFFECT AT " ..game.Workspace.time.Value.. "FOR THE FOLLOWING COUNTIES: Dallas County"
07        script.Parent.alert:TweenPosition(UDim2.new(-1.6,0,0,0), "In", "Linear", 16)
08        wait(16)
09        script.Parent.alert:TweenPosition(pos, "In", "Linear", 0)
10        script.Parent.randomtext.Disabled = false
11    wait(0.1)
12end
0
You have missed the end at the end of the script. narrowricky -14 — 6y
0
its because you never broke or set the condition to false, so it tweens the GUI every 0.1 seconds constantly; making that effect User#23365 30 — 6y
0
If you’ve going to Index the Scripts Parent so much, make a Variable Ziffixture 6913 — 6y

2 answers

Log in to vote
1
Answered by
Bertox 159
6 years ago

Hi, instead of using a loop you should use this event .Changed It fires then the Value got changed. That also should fix your error, it stutters because you use a loop and it keeps Tweening every 0.1 seconds

01function Alert()
02    if game.Workspace.severethunderstormwatch.Value == true then
03        local pos = script.Parent.alert.Position
04        script.Parent.TextLabel.Text = " "
05        script.Parent.randomtext.Disabled = true
06        script.Parent.alert.Text = "SEVERE THUNDERSTORM WATCH IN EFFECT AT " ..game.Workspace.time.Value.. "FOR THE FOLLOWING COUNTIES: Dallas County"
07        script.Parent.alert:TweenPosition(UDim2.new(-1.6,0,0,0), "In", "Linear", 16)
08        wait(16)
09        script.Parent.alert:TweenPosition(pos, "In", "Linear", 0)
10        script.Parent.randomtext.Disabled = false
11    end
12end
13 
14game.Workspace.severethunderstormwatch.Changed:Connect(Alert)

I am not a good scripter but I try to help

0
Doesnt work either. It still stutters. Edit: It seem to have been "TextScaled" causing the stutter effect, but im gonna accept this anyways as appreciation to your contribution. LoganboyInCO 150 — 6y
0
Ok thank you :D Bertox 159 — 6y
Ad
Log in to vote
0
Answered by 6 years ago

You have put the end in the wrong place and the wait you should put it like this

01while true do
02    if game.Workspace.severethunderstormwatch.Value == true then
03        local pos = script.Parent.alert.Position
04        script.Parent.TextLabel.Text = " "
05        script.Parent.randomtext.Disabled = true
06        script.Parent.alert.Text = "SEVERE THUNDERSTORM WATCH IN EFFECT AT " ..game.Workspace.time.Value.. "FOR THE FOLLOWING COUNTIES: Dallas County"
07        script.Parent.alert:TweenPosition(UDim2.new(-1.6,0,0,0), "In", "Linear", 16)
08        wait(16)
09        script.Parent.alert:TweenPosition(pos, "In", "Linear", 0)
10        script.Parent.randomtext.Disabled = false
11 
12end
13wait(0.1)
14end
0
Doesn't work at all. LoganboyInCO 150 — 6y

Answer this question