I can't tween color3 on ui

I am trying to tween the color3 value inside of the text button

Mouse enter is not working but mouse leave is working

I asked the assistant but still nothing changed

This is my code:

local menu = script.Parent.Parent
local tws = game:GetService(“TweenService”)

for i,_ in pairs(menu.Buttons:GetChildren()) do
_.MouseEnter:Connect(function()
print(“Mouse enter”)
script.enter:Play()
tws:Create(_,TweenInfo(0.3),{BackgroundColor = _.Color.Value }):Play()
end)
_.MouseLeave:Connect(function()
print(“Mouse leave”)
script.leave:Play()
tws:Create(_,TweenInfo.new(0.3),{BackgroundColor3 = Color3.new(1, 1, 1)}):Play()
end)


_.MouseButton1Click:Connect(function()
	print("Mouse press")
	script.click:Play()
end)
BackgroundColor = _.Color.Value 

the game might be confused and is thinking whether .Color is a property or an object. Use :FindFirstChild()

Nevermind, I forgot to add TweenInfo.new()

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