I think theres something wrong with the tweenposition

Hello! When I click the inventory button, the inventory frame seems like it doesn’t tween at the center.
Here’s the video about this and the code inside the inventory button(also the inv frame’s position is 0,0,0,0 after)
robloxapp-20231118-1739137.wmv (1.6 MB)

local button = script.Parent
local ScreenGui = button.Parent
local plr = game.Players.LocalPlayer
local ShopE = ScreenGui.InvE
local ts = game:GetService("TweenService")
local tsinfo = TweenInfo.new(
	0.4,
	Enum.EasingStyle.Linear,
	Enum.EasingDirection.Out,
	0,
	false,
	0
)
button.MouseButton1Click:Connect(function()
	ScreenGui.Inventory:TweenPosition(UDim2.new({0.199, 0},{0.275, 0}),Enum.EasingDirection.In,Enum.EasingStyle.Linear,0.4,true)
	button.Click:Play()
end)
button.MouseEnter:Connect(function()
	ts:Create(ShopE,tsinfo,{BackgroundTransparency = 0.5}):Play()
end)
button.MouseLeave:Connect(function()
	ts:Create(ShopE,tsinfo,{BackgroundTransparency = 1}):Play()
end)

Btw I found the bug on my own
Just remove the “{}” thingys

1 Like

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