Weird bug with Tween Service

Basically, the bug occurs when you tween an odd number which is greater than 228 (So numbers like 229,231,233, etc) to any number under 101 (I assume it would happen with 0 as well, but Color3 values don’t go under 0)

It also occurs when you tween an even number to an odd number. I’m not sure if it’s with every number, but the bug occurred with the numbers I tested it with.

Here’s an example script if you want to test it prior to reading the next section of what the bug is.

local TS = game:GetService("TweenService")
local tinfo = TweenInfo.new(1,Enum.EasingStyle.Linear, Enum.EasingDirection.Out,0,false,0)

local part = script.Parent

local startingColor = Color3.fromRGB(235,254,241)
local endColor = Color3.fromRGB(24,83,100)

part.Color = startingColor

TS:Create(part,tinfo,{Color = endColor}):Play()

When you do this, it will tween to 1 less to each of the RGB in the endColor, so instead of 24,83,100 it’ll be 23,82,99.

No idea why this happens, it only started happening today, as the scripts which I originally found this bug was working perfectly fine last night.

1 Like

Now this is really weird.If I change the values and add 1 to the RGB values, everything is fine except blue’s color is now 101 instead of the 100 I gave it.

1 Like

I’ve found the fix, change the 24,83,100 to 24.5,83.5,100.5

1 Like

Strange, i dont have this issue, this is what i did

T = game.TweenService

SC = Color3.fromRGB(235,254,241)
EC = Color3.fromRGB(24,83,100)

T:Create(script.Parent, TweenInfo.new(1), {Color = EC}):Play()

Is your studio updated? Mine still has the problem. I also check if game.TweenService and game:GetService(“TweenService”) made a difference and it didn’t.

My studio is updated, after testing again, i see the issue, but it isnt noticeable

So i recommend this:

T = game.TweenService

SC = Color3.fromRGB(235,254,241)
EC = Color3.fromRGB(24,83,100)

Tween = T:Create(script.Parent, TweenInfo.new(1), {Color = EC}):Play()

Tween.Completed:Connect(function()
   script.Parent.Color = EC
end)

Should set the Color properly after the tween is finished
If not, copy and paste the Color3 of EC over EC in the Completed function

1 Like

Wow, I didn’t think of that. Thank you!

PS: Thank you for my 60th Solution

1 Like

This topic was automatically closed 14 days after the last reply. New replies are no longer allowed.