Tween won't Function Properly

Hey! I’m trying to tween TextColor3 and the color change happens but it doesn’t tween; it’s almost like its just setting the Color3 to the property table instantly, but the Button ImageColor3 tweens normally. Anyone know why?

Specific Function I Predict Issue Is:

local tweenRed = function(button, on_off)
	local text_goal = {}
	local button_goal = {}
	if on_off == true then
		text_goal.TextColor3 = Color3.new(255, 255, 255)
		button_goal.ImageColor3 = Color3.new(1, 0.278431, 0.133333)
	else
		text_goal.TextColor3 = Color3.new(0.196078, 0.196078, 0.196078)
		button_goal.ImageColor3 = Color3.new(0.439216, 0.439216, 0.439216)
	end
	
	local Tween_Info = TweenInfo.new(TOGGLE_TIME, Enum.EasingStyle.Quart)	
	local textTween = TweenService:Create(button.TextLabel, Tween_Info, text_goal)
	local buttonTween = TweenService:Create(button, Tween_Info, button_goal)
	
	buttonTween:Play()
	textTween:Play()
end

Full Code:

-- VARS ||
local InputService = game:GetService("UserInputService")
local CollectionService = game:GetService("CollectionService")
local TweenService = game:GetService("TweenService")

local Background_Frame = script.Parent.BackgroundFrame
local Settings_Gui = script.Parent
local Game_Button = Background_Frame.GameButton
local Graphics_Button = Background_Frame.GraphicsButton
local Accessibility_Button = Background_Frame.AccessibilityButton
local Audio_Button = Background_Frame.AudioButton
local Controls_Button = Background_Frame.ControlsButton
local Button_Array = CollectionService:GetTagged("SettingsToggle")

local INPUT_TYPE
local SELECTED = Game_Button -- default selected tab when settings menu opens
local DEBOUNCE = false

local TOGGLE_TIME = 0.5
--

-- find inputType

if InputService.KeyboardEnabled and InputService.MouseEnabled then
	_G.InputType = 1
elseif InputService.TouchEnabled then
	_G.InputType = 2
elseif InputService.GamepadEnabled then
	_G.InputType = 3
	warn("Player's gamepad may not be suitable. Highly reccomended for users to adjust controls in settings.")
end

-- animations

local tweenRed = function(button, on_off)
	local text_goal = {}
	local button_goal = {}
	if on_off == true then
		text_goal.TextColor3 = Color3.new(255, 255, 255)
		button_goal.ImageColor3 = Color3.new(1, 0.278431, 0.133333)
	else
		text_goal.TextColor3 = Color3.new(0.196078, 0.196078, 0.196078)
		button_goal.ImageColor3 = Color3.new(0.439216, 0.439216, 0.439216)
	end
	
	local Tween_Info = TweenInfo.new(TOGGLE_TIME, Enum.EasingStyle.Quart)	
	local textTween = TweenService:Create(button.TextLabel, Tween_Info, text_goal)
	local buttonTween = TweenService:Create(button, Tween_Info, button_goal)
	
	buttonTween:Play()
	textTween:Play()
end

local tweenText_Light = function(button, on_off)
	local text_goal = {}
	if on_off == true then
		text_goal.TextColor3 = Color3.new(0.309804, 0.309804, 0.309804)
	else
		text_goal.TextColor3 = Color3.new(0.196078, 0.196078, 0.196078)
	end

	local Tween_Info = TweenInfo.new(TOGGLE_TIME, Enum.EasingStyle.Quart)
	local textTween = TweenService:Create(button.TextLabel, Tween_Info, text_goal)
	textTween:Play()
end

for INDEX, BUTTON : ImageButton in pairs(Button_Array) do
	BUTTON.MouseEnter:Connect(function()
		if SELECTED == BUTTON then
		else
			tweenText_Light(BUTTON, true)
		end
	end)
	BUTTON.MouseLeave:Connect(function()
		if SELECTED == BUTTON then
		else
			tweenText_Light(BUTTON, false)
		end
	end)
	
	BUTTON.MouseButton1Click:Connect(function()
		if DEBOUNCE == false then
			DEBOUNCE = true
			tweenRed(BUTTON, true)
			tweenRed(SELECTED, false)
			SELECTED = BUTTON
			wait(TOGGLE_TIME)
			DEBOUNCE = false
		end
	end)
end

2 Likes