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)
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)
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)
hi buddy
This discussion is preserved as it was. New answers, comments, and votes are closed.
3 comments
Whatever works bro
Trying to think of efficiency, less lag etc lol
I mean, other than detecting the mouse move, RenderStepped seems like a good way to update the frame’s position.