#How to put frame position relative to mouse position

1 messages · Page 1 of 1 (latest)

near flax
#

I figured how to make the frame go exactly at the mouse position but i want the frameX to start at the mouse not for it to be in the middle

karmic igloo
#

is the anchorpoint at (0, 0)

near flax
#

no. the anchor point was a .5 .5 but even at (0,0) the y of the frame is too far

young silo
#

I can only assume that you declared the position pre-emptively. So once you move your mouse and click the button (or whatever), that the position is already off

#

You can very easily make a frame fellow your mouse by just doing something like this.

local UIS = game:GetService("UserInputService")
local f = script.Parent.Frame

UIS.InputChanged:Connect(function(inp)
    if inp.UserInputType == Enum.UserInputType.MouseMovement then
        f.Position = UDim2.fromOffset(inp.Position.X,  inp.Position.Y)
    end
end)

just change that as you see fit

near flax
#

well i dont need it to follow my mouse but just to teleportwhere my mouse was previously