Tween too laggy / slow

Hello everyone,

I’m trying to make hover animation on frames but the tween is too slow and laggy

Client Script
local RegularFrame = script.Parent.Regular
local PremuimFrame = script.Parent:WaitForChild("Premuim")
local VIPFrame = script.Parent:WaitForChild("VIP")
local TweenService = game:GetService("TweenService")
local tweenInfo = TweenInfo.new(0.5)

local FrameEnter = Color3.new(0.67451, 0.45098, 0)

local FrameLeave = Color3.new(1, 0.666667, 0)

local Frames = {RegularFrame,PremuimFrame,VIPFrame} 

for i, frame in pairs(Frames) do
	frame.MouseEnter:Connect(function()
		local tween = TweenService:Create(frame, tweenInfo, {BackgroundColor3 = FrameEnter})
		tween:Play()
	end)
	frame.MouseLeave:Connect(function()
		local tween = TweenService:Create(RegularFrame, tweenInfo, {BackgroundColor3 = FrameLeave})
		tween:Play()
	end)
end

Video (GIF): https://gyazo.com/ad48f39f0122f0c5bc88ce4a035fc59c

Thanks for reading… :smiley:

You only assigned the tween to 1 of the Frames, but not all of them

This should fix it?

	frame.MouseLeave:Connect(function()
		local tween = TweenService:Create(frame, tweenInfo, {BackgroundColor3 = FrameLeave})
		tween:Play()
	end)
1 Like

Thanks I didn’t notice that,

It’s working thanks

Just make sure to double-check your code :wink: And np!

1 Like