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

TweenSize finishing faster than its desired time?

Asked by 6 years ago

Hi there.

For some reason, when this runs, it completely skips the two seconds that the tween is supposed to be running for. it does it instantaneously. Any ideas?

01mouse.Button1Down:Connect(function()
02        animTrack:Play()
03        stop = false
04        while stop == false do
05        wait() 
06        for _,iore in ipairs(ore) do
07 
08            if cursorObject.Parent.Name == iore and magnitude <= 10 and hit == false and cursorObject.Parent.Health.Value > 0 then
09                hitting = true
10                hit = true
11                local current = cursorObject.Parent.Name
12                local currenthealth = replicatedstorge:WaitForChild("Health"):InvokeServer(current)
13 
14                local function executeAfter(complete)
15                    print("hello")
View all 34 lines...

1 answer

Log in to vote
1
Answered by 6 years ago

Hello, FierceLeviathan.

Upon further examination of your code, one thing that definitely sticks out as an issue is that you put:

1local tween2 = progress:TweenSize(
2    UDim2.new(1,0,1,0),
3    Enum.EasingDirection.Out,
4    Enum.EasingStyle.Linear,
5    false,
6    2,
7    executeAfter
8)

The main issue here is that the parameters of TweenSize are endSize, easingDirection, easingStyle, time, override, and callback.

With that being said, your code should look more like this:

1local tween2 = progress:TweenSize(
2    UDim2.new(1,0,1,0),
3    Enum.EasingDirection.Out,
4    Enum.EasingStyle.Linear,
5    2,
6    false,
7    executeAfter
8)

Best of luck!

Source

0
Wow. I cannot believe I missed that. Thank you so much! FierceLeviathan 10 — 6y
0
No problem, friend. Rocketerkid 237 — 6y
0
Hey! Another thing, how would I go as to stop the tween when mouse.button1up occurs? Thanks again! FierceLeviathan 10 — 6y
Ad

Answer this question