Issue with Frame snapping to the mouse position

Alright, for some reason when I am constantly moving a frame to the mouse position there is a delay as if I were tweening the frame to the mouse position when it should be snapping to the mouse.

The issue I’m having only occurs when I’m in the actual game and not in studio.

I’ve tried using different types of loops to see if there would be a change in delay but there were no changes and I tried using the Move event of the mouse and yet there were no changes in result.

Most recent code:

game:GetService("RunService").RenderStepped:connect(function()
	local mp = game:GetService("UserInputService"):GetMouseLocation()
	script.Parent.Position = UDim2.new(0, mp.X, 0, mp.Y)
end)

Any help would be appreciated

1 Like

Where exactly is this script? And is it client or server-sided?

Sounds like a general Roblox occurrence. I’ve found that it happens a lot and that simply the mouse position isn’t always updated as much as shown and/or is slow. You can find it in all sorts of games like Blackhawk Rescue Mission 5 when not fully focused in the window. As far as I know, there’s not exactly a fix and is mostly on role for Roblox.

1 Like

Thanks for clearing that up for me.

Also, if it’s getting the mouse it would be a client script.

This topic was automatically closed 14 days after the last reply. New replies are no longer allowed.