invGrid.MouseEnter:Connect(function()
currentGrid = invGrid
if currentItemDrag then
if currentItemDrag.Parent ~= invBack then
currentItemDrag.Parent = invBack
end
end
end)
dropGrid.MouseEnter:Connect(function()
currentGrid = dropGrid
if currentItemDrag.Parent ~= dropBackground then
currentItemDrag.Parent = dropBackground
end
end)
uis.InputChanged:Connect(function(input, gameProcessed)
if (currentItemDrag) and (input.UserInputType == Enum.UserInputType.MouseMovement) then
local mousePos = input.Position;
currentItemDrag.Position = UDim2.new(0, mousePos.X - mouseOffset.X, 0, mousePos.Y - mouseOffset.Y);
end
end)
local function loadInventoryItems()
for _, item in pairs(inventory:GetChildren()) do
local itemFrame = item:Clone()
itemFrame.MouseButton1Down:Connect(function()
currentItemDrag = itemFrame
local mousePos = uis:GetMouseLocation() - Vector2.new(0, 36)
local itemPosOffset = Vector2.new(mousePos.X - currentItemDrag.Position.X.Offset, mousePos.Y - currentItemDrag.Position.Y.Offset)
mouseOffset = itemPosOffset
end)
itemFrame.Parent = invBack
end
end
Hm… I think you need to write what is the problem. Very hard to know if you dont tell us.
from the code and image, I don’t know if it’s necessary, but it’s ok, sorry, the white frame needs to be together with the mouse, but it is far away, as in the second image, this problem happens when entering another black frame

