I’m trying to find a way to make the fake mouse move in a circular direction (clamped from the real mouse’s position):
I have a script but it moves in a square pattern instead of a circular one, and once going closer to the center, it goes to the mouse’s position instead of being in the circle’s pattern position.
This is my current script:
local radius = 200
game:GetService("RunService").RenderStepped:Connect(function()
local absSize = script.Parent.Parent.AbsoluteSize
local centerPos = absSize / 2
local mousePos = Vector2.new(
game:GetService("UserInputService"):GetMouseLocation().X,
game:GetService("UserInputService"):GetMouseLocation().Y
)
script.Parent.Position = UDim2.fromOffset( math.clamp(mousePos.X, centerPos.X - radius, centerPos.X + radius), math.clamp(mousePos.Y, centerPos.Y - radius, centerPos.Y + radius) )
end)