So I’ve made a script of equipping a tool that would work differently than the regular roblox hotbar and one of the features that I added to it was the weapon icon that changes colors when you equip it and unequip it but it’s color changes instantly while ignoring the tweeninfo’s timer and going straight to the other color.
The script (Only the tween service part):
local tween = game:GetService("TweenService")
local dest = {}
dest.ImageColor3 = Color3.new(255,255,255)
local tweeninfo = TweenInfo.new(1,Enum.EasingStyle.Linear,Enum.EasingDirection.In,0,false,0)
local fin = tween:Create(script.Parent.ImageLabel,tweeninfo,dest)
wait(1)
fin:Play()
This is because your changing the colors before the tween
Here is the full code
local tween = game:GetService("TweenService")
local dest = {}
local tweeninfo = TweenInfo.new(1,Enum.EasingStyle.Linear,Enum.EasingDirection.In,0,false,0)
local fin = tween:Create(script.Parent.ImageLabel,tweeninfo,dest)
task.wait(1)
dest.ImageColor3 = Color3.new(255,255,255)
fin:Play()
its not, you are changing values of dest table. it wont change tween’s configuration, your script makes no sense.
Also its not Color3.new(255,255,255), Its should be Color3.fromRBG(255,255,255) Color3.new() takes values from range 0-1.
it doesnt ignore the tween timer tho
In your example, you are creating the tween without giving it any value to change to (dest in their code is not the Image Label, but the desired goal). The original setup is correct, but I suspect that @koi_code is correct and that the issue lies in the color format they have used.
local tween = game:GetService("TweenService")
local tweeninfo = TweenInfo.new(1,Enum.EasingStyle.Linear,Enum.EasingDirection.In,0,false,0)
local fin = tween:Create(script.Parent.ImageLabel,tweeninfo,ImageColor3 = Color3.fromRGB(255,255,255))
wait(1)
fin:Play()
local tween = game:GetService("TweenService")
local dest = {}
dest.ImageColor3 = Color3.fromRGB(255,255,255)
local tweeninfo = TweenInfo.new(1,Enum.EasingStyle.Linear,Enum.EasingDirection.In,0,false,0)
local fin = tween:Create(script.Parent.ImageLabel,tweeninfo,dest)
wait(1)
fin:Play()
You’ll notice that the only change is Color3.new has been changed to Color3.FromRGB