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

Could somebody help me with fixing this UI script involving tweens?

Asked by 4 years ago

The problem is that the progress bars for the other abilities won't work at all anymore. The one for the special ability works only the first time, but it doesn't reset, and the other ones don't work at all. I literally don't even know what I'm doing wrong. I checked the API references, play-tested a bunch of times, etc. Nothing's worked. I'm not even sure how I should debug this either. What is going on here?

01local screenGui = script.Parent.Parent
02local player = game:GetService("Players").LocalPlayer
03 
04local Events = game:GetService("ReplicatedStorage").RemoteEventsAndFunctions
05local SetHUDProgressBar = Events.SetHUDProgressBar
06local SpecialAbilityReady = Events.Abilities.SpecialAbilityReady
07 
08workspace:WaitForChild(player.Name)
09 
10local character = player.Character
11local ability1ProgressBar = script.Parent.Ability1.Progress
12local ability2ProgressBar = script.Parent.Ability2.Progress
13local ability3ProgressBar = script.Parent.Ability3.Progress
14local specialAbilityProgressBar = script.Parent.Parent.SpecialAbility.Progress
15 
View all 57 lines...
0
It just won't tween. It'll set the size, it'll even have the callback function fire after, but it won't tween at all acer1102 97 — 4y

2 answers

Log in to vote
0
Answered by
1JBird1 64
4 years ago

I didn’t see a Play() anywhere in the script, I’m guessing that you want to play on line 46 then maybe try doing

1specialAbilityProgressBar:TweenSize(UDim2.new(1,0,clampedProgress,0),Enum.EasingDirection.InOut, Enum.EasingStyle.Linear, animTime, true, callback):Play()

on line 46, though i’ve only done tweening on 3D objects so im unsure.

0
When you call any tween operation for a GUI object it automatically plays as soon as it's called acer1102 97 — 3y
Ad
Log in to vote
0
Answered by 3 years ago

So I took a break from this project shortly after I posted this for various reasons, but since I came back to it I worked around it and it now works

Answer this question