Frame not going to mouse

Hey there! I’m trying to create a commands frame with a system where if you hover over a command it will give you information about the command. It’s not working, as the information frame is going crazy when you hover over a command.

The command frame:

My code:

local Mouse = game.Players.LocalPlayer:GetMouse()
local hover = script.Parent.Parent.Parent.InfoHover

script.Parent.MouseEnter:Connect(function()
	hover.Visible = true
	
	hover.Position = UDim2.new(0, Mouse.X,0, Mouse.Y)
end)

script.Parent.MouseLeave:Connect(function()
	hover.Visible = false
end)

Any help will be appreciated as I have absolutely no idea what’s going wrong.

Try doing:

Pos = Vector2.new(Mouse.X-parentFrame.AbsolutePosition.X, Mouse.Y-parentFrame.AbsolutePosition.Y)

Then translating that over to the framed position

1 Like