Unabled to cast Instance to TweenInfo help

I need help with this.

local MainGui = {}

local TweenService = game:GetService("TweenService")

local Info = TweenInfo.new(
	0.5,
	Enum.EasingStyle.Quad,
	Enum.EasingDirection.Out,
	1,
	false,
	0
)

local CanHover = true

function MainGui.Gui(MainScreenGui)
	if MainScreenGui:IsA("ScreenGui") then
		
		local Play = MainScreenGui.Play
		local Store = MainScreenGui.Store
		local Info = MainScreenGui.Info
		local Settings = MainScreenGui.Settings
		
		local Arrow = MainScreenGui:WaitForChild("Arrow")
		
		Play.MouseEnter:Connect(function()
			local ArrowAnim = TweenService:Create(Arrow, Info, {Position = UDim2.new(0.216, 0,0.392, 0)})
			ArrowAnim:Play()
		end)
		Store.MouseEnter:Connect(function()
			local ArrowAnim = TweenService:Create(Arrow, Info, {Position = UDim2.new(0.216, 0,0.453, 0)})
			ArrowAnim:Play()
		end)
		Info.MouseEnter:Connect(function()
			local ArrowAnim = TweenService:Create(Arrow, Info, {Position = UDim2.new(0.216, 0,0.515, 0)})
			ArrowAnim:Play()
		end)
		Settings.MouseEnter:Connect(function()
			local ArrowAnim = TweenService:Create(Arrow, Info, {Position = UDim2.new(0.216, 0,0.575, 0)})
			ArrowAnim:Play()
		end)
		
	end
end

return MainGui

Captura de pantalla 2023-09-27 213606
Captura de pantalla 2023-09-27 213630

I don’t see the error here. Please help me

Could you quote the line so I know which one it is?

1 Like

I see the problem, first you have tweeninfo set on the Info variable, and then you overwrite it with a new frame. Change the variable of one of the two.

1 Like

So I would give this one a different name (The variable).

1 Like

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