Scripting HelpersARCHIVE
A little piece of Roblox history. Preserved for everyone, one question at a time.Read about the archive →
✓ ANSWER ACCEPTED

What is the ideal method to make a frame move with the mouse? (Opinion)

I was wondering which is the best way to make a frame's position change with the mouse's X and Y axis.

I have done it before using RenderStepped, I'm not sure whether it is the ideal method of doing so in 2018...??

(I'm asking for opinions)

3 comments

0

Whatever works bro

0

Trying to think of efficiency, less lag etc lol

0

I mean, other than detecting the mouse move, RenderStepped seems like a good way to update the frame’s position. 

1 answer

✓ Accepted answer

The Move event of PlayerMouse (Mouse.Move) is the best for this situation.

local Mouse = game.Players.LocalPlayer:GetMouse()
Mouse.Move:Connect(function()
	local X = Mouse.X
	local Y = Mouse.Y
	Frame.Position = UDim2.new(0,X,0,Y)
end)

1 comment

0

hi buddy

This discussion is preserved as it was. New answers, comments, and votes are closed.