Just wanted to know if anyone prefers to use Mouse.Move since it only updates the frames position when the mouse moves, which I prefer this as it wont affect performance. Where renderstepped updates every frame. What are your thoughts? Is it recommended to use renderstepped for some circumstances? Or Move function would lag if the mouse moved mad (real fast)?
local mouse = game.Players.LocalPlayer:GetMouse() local Frame = script.Parent.Frame mouse.Move:Connect(function() Frame.Position = UDim2.new(0, mouse.x, 0, mouse.Y) print(Frame.Position) end)
or
local mouse = game.Players.LocalPlayer:GetMouse() local Frame = script.Parent.Frame game:GetService("RunService").RenderStepped:Connect(function() Frame.Position = UDim2.new(0, mouse.x, 0, mouse.Y) print(Frame.Position) end)
Maybe both?
local mouse = game.Players.LocalPlayer:GetMouse() local Frame = script.Parent.Frame local rs,debounce=game:GetService("RunService"),false mouse.Move:Connect(function() if debounce then return end debounce=true Frame.Position = UDim2.new(0, mouse.x, 0, mouse.Y) print(Frame.Position) rs.RenderStepped:Wait() debounce=false end)